diff --git a/OWNERS_ALIASES b/OWNERS_ALIASES index e372db08593..f1e11fc80d7 100644 --- a/OWNERS_ALIASES +++ b/OWNERS_ALIASES @@ -35,6 +35,15 @@ aliases: - mandre - mdbooth - pierreprinetti + powervs-approvers: + - Prashanth684 + - clnperez + - mkumatag + powervs-reviewers: + - 23TNC + - clnperez + - mkumatag + - Prashanth684 vsphere-approvers: - dav1x - jcpowermac diff --git a/data/data/powervs/bootstrap/main.tf b/data/data/powervs/bootstrap/main.tf new file mode 100644 index 00000000000..72346f55e84 --- /dev/null +++ b/data/data/powervs/bootstrap/main.tf @@ -0,0 +1,88 @@ +# TODO(mjturek): network and image data blocks can be in main module +# as master and bootstrap will be using the same +# network and image. Once we add in master module, make +# the move. +data "ibm_pi_network" "network" { + pi_network_name = var.network_name + pi_cloud_instance_id = var.cloud_instance_id +} + +data "ibm_pi_image" "bootstrap_image" { + pi_image_name = var.image_name + pi_cloud_instance_id = var.cloud_instance_id +} + +data "ignition_config" "bootstrap" { + merge { + source = ibms3presign.bootstrap_ignition.presigned_url + } +} + +data "ibm_resource_group" "cos_group" { + name = var.resource_group +} + +resource "ibm_resource_instance" "cos_instance" { + name = "${var.cluster_id}-cos" + resource_group_id = data.ibm_resource_group.cos_group.id + service = "cloud-object-storage" + plan = "standard" + location = var.cos_instance_location + tags = [var.cluster_id] +} + +# Create an IBM COS Bucket to store ignition +resource "ibm_cos_bucket" "ignition" { + bucket_name = "${var.cluster_id}-bootstrap-ign" + resource_instance_id = ibm_resource_instance.cos_instance.id + region_location = var.cos_bucket_location + storage_class = var.cos_storage_class +} + +resource "ibm_resource_key" "cos_service_cred" { + name = "${var.cluster_id}-cred" + role = "Reader" + resource_instance_id = ibm_resource_instance.cos_instance.id + parameters = { HMAC = true } +} + +resource "ibms3presign" "bootstrap_ignition" { + access_key_id = ibm_resource_key.cos_service_cred.credentials["cos_hmac_keys.access_key_id"] + secret_access_key = ibm_resource_key.cos_service_cred.credentials["cos_hmac_keys.secret_access_key"] + bucket_name = "${var.cluster_id}-bootstrap-ign" + key = "bootstrap.ign" + region_location = ibm_cos_bucket.ignition.region_location + storage_class = ibm_cos_bucket.ignition.storage_class +} + +# Place the bootstrap ignition file in the ignition COS bucket +resource "ibm_cos_bucket_object" "ignition" { + bucket_crn = ibm_cos_bucket.ignition.crn + bucket_location = ibm_cos_bucket.ignition.region_location + content = var.ignition + key = "bootstrap.ign" +} + +# Create the bootstrap instance +resource "ibm_pi_instance" "bootstrap" { + pi_memory = var.memory + pi_processors = var.processors + pi_instance_name = "${var.cluster_id}-bootstrap" + pi_proc_type = var.proc_type + pi_image_id = data.ibm_pi_image.bootstrap_image.id + pi_sys_type = var.sys_type + pi_cloud_instance_id = var.cloud_instance_id + pi_network_ids = [data.ibm_pi_network.network.id] + + pi_user_data = base64encode(data.ignition_config.bootstrap.rendered) + pi_key_pair_name = var.key_id + pi_health_status = "WARNING" +} + +data "ibm_pi_instance_ip" "bootstrap_ip" { + depends_on = [ibm_pi_instance.bootstrap] + + pi_instance_name = ibm_pi_instance.bootstrap.pi_instance_name + pi_network_name = data.ibm_pi_network.network.pi_network_name + pi_cloud_instance_id = var.cloud_instance_id +} diff --git a/data/data/powervs/bootstrap/outputs.tf b/data/data/powervs/bootstrap/outputs.tf new file mode 100644 index 00000000000..72b65f4787c --- /dev/null +++ b/data/data/powervs/bootstrap/outputs.tf @@ -0,0 +1,3 @@ +output "bootstrap_ip" { + value = data.ibm_pi_instance_ip.bootstrap_ip.ip +} diff --git a/data/data/powervs/bootstrap/variables.tf b/data/data/powervs/bootstrap/variables.tf new file mode 100644 index 00000000000..c2f744e7b97 --- /dev/null +++ b/data/data/powervs/bootstrap/variables.tf @@ -0,0 +1,16 @@ +variable "memory" {} +variable "processors" {} +variable "ignition" {} + +variable "cloud_instance_id" {} +variable "resource_group" {} +variable "image_name" {} +variable "network_name" {} +variable "proc_type" {} +variable "sys_type" {} +variable "cluster_id" {} +variable "key_id" {} + +variable "cos_instance_location" {} +variable "cos_bucket_location" {} +variable "cos_storage_class" {} diff --git a/data/data/powervs/dns/dns.tf b/data/data/powervs/dns/dns.tf new file mode 100644 index 00000000000..276515abcfa --- /dev/null +++ b/data/data/powervs/dns/dns.tf @@ -0,0 +1,31 @@ +data "ibm_cis_domain" "base_domain" { + cis_id = var.cis_id + domain = var.base_domain +} + +resource "ibm_cis_dns_record" "kubernetes_api" { + cis_id = var.cis_id + domain_id = data.ibm_cis_domain.base_domain.id + type = "CNAME" + name = "api.${var.cluster_domain}" + content = var.load_balancer_hostname + ttl = 60 +} + +resource "ibm_cis_dns_record" "kubernetes_api_internal" { + cis_id = var.cis_id + domain_id = data.ibm_cis_domain.base_domain.id + type = "CNAME" + name = "api-int.${var.cluster_domain}" + content = var.load_balancer_int_hostname + ttl = 60 +} + +resource "ibm_cis_dns_record" "apps" { + cis_id = var.cis_id + domain_id = data.ibm_cis_domain.base_domain.id + type = "CNAME" + name = "*.apps.${var.cluster_domain}" + content = var.load_balancer_hostname + ttl = 60 +} diff --git a/data/data/powervs/dns/variables.tf b/data/data/powervs/dns/variables.tf new file mode 100644 index 00000000000..c7631cae426 --- /dev/null +++ b/data/data/powervs/dns/variables.tf @@ -0,0 +1,13 @@ +variable "cis_id" {} + +variable "base_domain" {} + +variable "cluster_domain" {} + +variable "load_balancer_hostname" {} + +variable "load_balancer_int_hostname" {} + + + + diff --git a/data/data/powervs/iaas/power-iaas.tf b/data/data/powervs/iaas/power-iaas.tf new file mode 100644 index 00000000000..071535e415b --- /dev/null +++ b/data/data/powervs/iaas/power-iaas.tf @@ -0,0 +1,22 @@ +provider "ibm" { + ibmcloud_api_key = var.powervs_api_key +} + +data "ibm_resource_group" "group" { + name = var.powervs_resource_group +} + +resource "ibm_resource_instance" "resource_instance" { + name = "${var.cluster_id}-power-iaas" + service = "power-iaas" + plan = "power-virtual-server-group" + location = var.powervs_region + tags = concat(var.service_tags, ["${var.cluster_id}-power-iaas", "${var.cluster_id}"]) + resource_group_id = data.ibm_resource_group.group.id + + timeouts { + create = "10m" + update = "10m" + delete = "10m" + } +} diff --git a/data/data/powervs/iaas/variables.tf b/data/data/powervs/iaas/variables.tf new file mode 100644 index 00000000000..c9569ff8808 --- /dev/null +++ b/data/data/powervs/iaas/variables.tf @@ -0,0 +1,28 @@ +variable "powervs_api_key" { + type = string + description = "IBM Cloud API key associated with user's identity" + default = "" +} + +variable "powervs_resource_group" { + type = string + description = "The cloud instance resource group" + default = "" +} + +variable "powervs_region" { + type = string + description = "The IBM Cloud region where you want to create the resources" + default = "" +} + +variable "cluster_id" { + type = string + default = "" +} + +variable "service_tags" { + type = list(string) + description = "A list of tags for our resource instance." + default = [] +} diff --git a/data/data/powervs/loadbalancer/alb.tf b/data/data/powervs/loadbalancer/alb.tf new file mode 100644 index 00000000000..3dfec80e94c --- /dev/null +++ b/data/data/powervs/loadbalancer/alb.tf @@ -0,0 +1,120 @@ +locals { + api_servers = concat([var.bootstrap_ip], var.master_ips) + api_servers_count = length(var.master_ips) + 1 # bootstrap + master + app_servers = var.master_ips + app_servers_count = length(var.master_ips) +} + +data "ibm_resource_group" "resource_group" { + name = var.resource_group +} + +resource "ibm_is_lb" "load_balancer" { + name = "${var.cluster_id}-loadbalancer" + resource_group = data.ibm_resource_group.resource_group.id + subnets = [var.vpc_subnet_id] + security_groups = [ibm_is_security_group.ocp_security_group.id] + tags = [var.cluster_id, "${var.cluster_id}-loadbalancer"] + type = "public" +} + +resource "ibm_is_lb" "load_balancer_int" { + name = "${var.cluster_id}-loadbalancer-int" + resource_group = data.ibm_resource_group.resource_group.id + subnets = [var.vpc_subnet_id] + security_groups = [ibm_is_security_group.ocp_security_group.id] + tags = [var.cluster_id, "${var.cluster_id}-loadbalancer-int"] + type = "private" +} + +# Using explicit depends_on as otherwise there are issues with updating and adding of pool members +# Ref: https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/is_lb_listener + +## TODO move this to internal/private LB +# machine config listener and backend pool +resource "ibm_is_lb_listener" "machine_config_listener" { + lb = ibm_is_lb.load_balancer_int.id + port = 22623 + protocol = "tcp" + default_pool = ibm_is_lb_pool.machine_config_pool.id +} +resource "ibm_is_lb_pool" "machine_config_pool" { + depends_on = [ibm_is_lb.load_balancer_int] + + name = "machine-config-server" + lb = ibm_is_lb.load_balancer_int.id + algorithm = "round_robin" + protocol = "tcp" + health_delay = 60 + health_retries = 5 + health_timeout = 30 + health_type = "tcp" +} +resource "ibm_is_lb_pool_member" "machine_config_member" { + depends_on = [ibm_is_lb_listener.machine_config_listener] + count = local.api_servers_count + + lb = ibm_is_lb.load_balancer_int.id + pool = ibm_is_lb_pool.machine_config_pool.id + port = 22623 + target_address = local.api_servers[count.index] +} + +# api listener and backend pool (internal) +resource "ibm_is_lb_listener" "api_listener_int" { + lb = ibm_is_lb.load_balancer_int.id + port = 6443 + protocol = "tcp" + default_pool = ibm_is_lb_pool.api_pool_int.id +} +resource "ibm_is_lb_pool" "api_pool_int" { + depends_on = [ibm_is_lb.load_balancer_int] + + name = "openshift-api-server" + lb = ibm_is_lb.load_balancer_int.id + algorithm = "round_robin" + protocol = "tcp" + health_delay = 60 + health_retries = 5 + health_timeout = 30 + health_type = "tcp" +} +resource "ibm_is_lb_pool_member" "api_member_int" { + depends_on = [ibm_is_lb_listener.api_listener_int, ibm_is_lb_pool_member.machine_config_member] + count = local.api_servers_count + + lb = ibm_is_lb.load_balancer_int.id + pool = ibm_is_lb_pool.api_pool_int.id + port = 6443 + target_address = local.api_servers[count.index] +} + +# api listener and backend pool (external) +resource "ibm_is_lb_listener" "api_listener" { + lb = ibm_is_lb.load_balancer.id + port = 6443 + protocol = "tcp" + default_pool = ibm_is_lb_pool.api_pool.id +} +resource "ibm_is_lb_pool" "api_pool" { + depends_on = [ibm_is_lb.load_balancer] + + name = "openshift-api-server" + lb = ibm_is_lb.load_balancer.id + algorithm = "round_robin" + protocol = "tcp" + health_delay = 60 + health_retries = 5 + health_timeout = 30 + health_type = "tcp" +} +resource "ibm_is_lb_pool_member" "api_member" { + depends_on = [ibm_is_lb_listener.api_listener, ibm_is_lb_pool_member.machine_config_member] + count = local.api_servers_count + + lb = ibm_is_lb.load_balancer.id + pool = ibm_is_lb_pool.api_pool.id + port = 6443 + target_address = local.api_servers[count.index] +} + diff --git a/data/data/powervs/loadbalancer/outputs.tf b/data/data/powervs/loadbalancer/outputs.tf new file mode 100644 index 00000000000..b4c6c184fb8 --- /dev/null +++ b/data/data/powervs/loadbalancer/outputs.tf @@ -0,0 +1,7 @@ +output "powervs_lb_hostname" { + value = ibm_is_lb.load_balancer.hostname +} + +output "powervs_lb_int_hostname" { + value = ibm_is_lb.load_balancer_int.hostname +} diff --git a/data/data/powervs/loadbalancer/sg.tf b/data/data/powervs/loadbalancer/sg.tf new file mode 100644 index 00000000000..ca32b52ba37 --- /dev/null +++ b/data/data/powervs/loadbalancer/sg.tf @@ -0,0 +1,28 @@ +locals { + tcp_ports = [22623, 6443] +} +data "ibm_is_vpc" "vpc" { + name = var.vpc_name +} + +resource "ibm_is_security_group" "ocp_security_group" { + name = "${var.cluster_id}-ocp-sec-group" + resource_group = data.ibm_resource_group.resource_group.id + vpc = data.ibm_is_vpc.vpc.id + tags = [var.cluster_id] +} + +resource "ibm_is_security_group_rule" "inbound_ports" { + count = length(local.tcp_ports) + group = ibm_is_security_group.ocp_security_group.id + direction = "inbound" + tcp { + port_min = local.tcp_ports[count.index] + port_max = local.tcp_ports[count.index] + } +} + +resource "ibm_is_security_group_rule" "outbound_any" { + group = ibm_is_security_group.ocp_security_group.id + direction = "outbound" +} diff --git a/data/data/powervs/loadbalancer/variables.tf b/data/data/powervs/loadbalancer/variables.tf new file mode 100644 index 00000000000..c64b3344fa4 --- /dev/null +++ b/data/data/powervs/loadbalancer/variables.tf @@ -0,0 +1,9 @@ +variable "cluster_id" {} + +variable "vpc_name" {} +variable "vpc_subnet_id" {} + +variable "bootstrap_ip" {} +variable "master_ips" {} + +variable "resource_group" {} diff --git a/data/data/powervs/main.tf b/data/data/powervs/main.tf new file mode 100644 index 00000000000..435b17d8511 --- /dev/null +++ b/data/data/powervs/main.tf @@ -0,0 +1,108 @@ +provider "ibm" { + alias = "vpc" + ibmcloud_api_key = var.powervs_api_key + region = var.powervs_vpc_region + zone = var.powervs_vpc_zone +} + +provider "ibm" { + alias = "powervs" + ibmcloud_api_key = var.powervs_api_key + region = var.powervs_region + zone = var.powervs_zone +} + +resource "ibm_pi_key" "cluster_key" { + provider = ibm.powervs + pi_key_name = "${var.cluster_id}-key" + pi_ssh_key = var.powervs_ssh_key + pi_cloud_instance_id = var.powervs_cloud_instance_id +} + +module "bootstrap" { + providers = { + ibm = ibm.powervs + } + source = "./bootstrap" + cloud_instance_id = var.powervs_cloud_instance_id + cluster_id = var.cluster_id + resource_group = var.powervs_resource_group + + cos_instance_location = var.powervs_cos_instance_location + cos_bucket_location = var.powervs_cos_bucket_location + cos_storage_class = var.powervs_cos_storage_class + + memory = var.powervs_bootstrap_memory + processors = var.powervs_bootstrap_processors + ignition = var.ignition_bootstrap + sys_type = var.powervs_sys_type + proc_type = var.powervs_proc_type + key_id = ibm_pi_key.cluster_key.key_id + image_name = var.powervs_image_name + network_name = var.powervs_network_name +} + +module "master" { + providers = { + ibm = ibm.powervs + } + source = "./master" + cloud_instance_id = var.powervs_cloud_instance_id + cluster_id = var.cluster_id + resource_group = var.powervs_resource_group + instance_count = var.master_count + + memory = var.powervs_master_memory + processors = var.powervs_master_processors + ignition = var.ignition_master + sys_type = var.powervs_sys_type + proc_type = var.powervs_proc_type + key_id = ibm_pi_key.cluster_key.key_id + image_name = var.powervs_image_name + network_name = var.powervs_network_name +} + +data "ibm_is_subnet" "vpc_subnet" { + provider = ibm.vpc + name = var.powervs_vpc_subnet_name +} + +data "ibm_pi_image" "boot_image" { + provider = ibm.powervs + pi_image_name = var.powervs_image_name + pi_cloud_instance_id = var.powervs_cloud_instance_id +} + +data "ibm_pi_network" "pvs_net" { + provider = ibm.powervs + pi_network_name = var.powervs_network_name + pi_cloud_instance_id = var.powervs_cloud_instance_id +} + +module "loadbalancer" { + providers = { + ibm = ibm.vpc + } + source = "./loadbalancer" + + cluster_id = var.cluster_id + vpc_name = var.powervs_vpc_name + vpc_subnet_id = data.ibm_is_subnet.vpc_subnet.id + bootstrap_ip = module.bootstrap.bootstrap_ip + master_ips = module.master.master_ips + resource_group = var.powervs_resource_group +} + + +module "dns" { + providers = { + ibm = ibm.vpc + } + source = "./dns" + + cis_id = var.powervs_cis_crn + base_domain = var.base_domain + cluster_domain = var.cluster_domain + load_balancer_hostname = module.loadbalancer.powervs_lb_hostname + load_balancer_int_hostname = module.loadbalancer.powervs_lb_int_hostname +} diff --git a/data/data/powervs/master/main.tf b/data/data/powervs/master/main.tf new file mode 100644 index 00000000000..568526cd027 --- /dev/null +++ b/data/data/powervs/master/main.tf @@ -0,0 +1,39 @@ +# TODO(mjturek): network and image data blocks can be in main module +# as master and bootstrap will be using the same +# network and image. Once we add in master module, make +# the move. +data "ibm_pi_network" "network" { + pi_network_name = var.network_name + pi_cloud_instance_id = var.cloud_instance_id +} + +data "ibm_pi_image" "master_image" { + pi_image_name = var.image_name + pi_cloud_instance_id = var.cloud_instance_id +} + +# Create the master instances +resource "ibm_pi_instance" "master" { + count = var.instance_count + pi_memory = var.memory + pi_processors = var.processors + pi_instance_name = "${var.cluster_id}-master-${count.index}" + pi_proc_type = var.proc_type + pi_image_id = data.ibm_pi_image.master_image.id + pi_sys_type = var.sys_type + pi_cloud_instance_id = var.cloud_instance_id + pi_network_ids = [data.ibm_pi_network.network.id] + + pi_user_data = base64encode(var.ignition) + pi_key_pair_name = var.key_id + pi_health_status = "WARNING" +} + +data "ibm_pi_instance_ip" "master_ip" { + count = var.instance_count + depends_on = [ibm_pi_instance.master] + + pi_instance_name = ibm_pi_instance.master[count.index].pi_instance_name + pi_network_name = data.ibm_pi_network.network.pi_network_name + pi_cloud_instance_id = var.cloud_instance_id +} diff --git a/data/data/powervs/master/outputs.tf b/data/data/powervs/master/outputs.tf new file mode 100644 index 00000000000..910e18ebb0b --- /dev/null +++ b/data/data/powervs/master/outputs.tf @@ -0,0 +1,3 @@ +output "master_ips" { + value = data.ibm_pi_instance_ip.master_ip.*.ip +} diff --git a/data/data/powervs/master/variables.tf b/data/data/powervs/master/variables.tf new file mode 100644 index 00000000000..7168d59b459 --- /dev/null +++ b/data/data/powervs/master/variables.tf @@ -0,0 +1,14 @@ +variable "instance_count" {} + +variable "memory" {} +variable "processors" {} +variable "ignition" {} +variable "key_id" {} + +variable "cloud_instance_id" {} +variable "resource_group" {} +variable "image_name" {} +variable "network_name" {} +variable "proc_type" {} +variable "sys_type" {} +variable "cluster_id" {} diff --git a/data/data/powervs/topology/pi_network.tf b/data/data/powervs/topology/pi_network.tf new file mode 100644 index 00000000000..5f5e3a5f7c9 --- /dev/null +++ b/data/data/powervs/topology/pi_network.tf @@ -0,0 +1,40 @@ +## Network +## These are be optional arguments in the install-config (e.g. Platform) +## so that users may specify them. Have them be "hidden" in that the survey doesn't ask for them +## unless the OCP leads disagree. +## And since they're optional, use the count = construct to conditionally create them if the tf +## vars are unset. + +## Note, the following are incomplete placeholders to be tested and reviewed later when the TF +## support for these has been added to the ibmcloud terraform provider (which is now forked into +## https://github.com/openshift/terraform-provider-ibm) + +#resource "ibm_direct_link" "ocp_direct_link" { +# TODO +#} + +#resource "ibm_pi_network" "ocp_network" { +# provider = ibm.powervs +# count = var.powervs_network_name == "" ? 1 : 0 +# pi_network_name = "pvs-net-${var.cluster_id}" +# pi_cloud_instance_id = "powervs_cloud_instance_id" +# pi_network_type = "dhcp" +# pi_cidr = "192.168.0.0/24" +# pi_dns = [<"DNS Servers">] +#} + +#resource "ibm_is_vpc" "ocp_vpc" { +# provider = ibm.vpc +# count = var.powervs_vpc == "" ? 1 : 0 +# name = "vpc_${var.cluster_id}" +# classic_access = false +# resource_group = var.powervs_resource_group +#} + +#resource "ibm_is_subnet" "ocp_vpc_subnet" { +# provider = ibm.vpc +# count = var.powervs_vpc_subnet == "" ? 1 : 0 +# name = "vpc_subnet_${var.cluster_id}" +# vpc = ibm_is_vpc..id +# ipv4_cidr_block = "192.168.0.0/1" +#} diff --git a/data/data/powervs/variables-powervs.tf b/data/data/powervs/variables-powervs.tf new file mode 100644 index 00000000000..d172530f49d --- /dev/null +++ b/data/data/powervs/variables-powervs.tf @@ -0,0 +1,145 @@ +################################################################ +# Configure the IBM Cloud provider +################################################################ +variable "powervs_api_key" { + type = string + description = "IBM Cloud API key associated with user's identity" + default = "" +} + +variable "powervs_vpc_region" { + type = string + description = "The IBM Cloud region where you want to create the resources" + default = "eu-gb" +} + +variable "powervs_vpc_zone" { + type = string + description = "The IBM Cloud zone associated with the VPC region you're using" +} + +variable "powervs_region" { + type = string + description = "The IBM Cloud region where you want to create the resources" + default = "lon" +} + +variable "powervs_zone" { + type = string + description = "The IBM Cloud zone associated with the region you're using" +} + +variable "powervs_resource_group" { + type = string + description = "The cloud instance resource group" +} + +variable "powervs_cloud_instance_id" { + type = string + description = "The cloud instance ID of your account" +} + +################################################################ +# Configure storage +################################################################ +variable "powervs_cos_instance_location" { + type = string + description = "The location of your COS instance" + default = "global" +} + +variable "powervs_cos_bucket_location" { + type = string + description = "The location to create your COS bucket" + default = "us-east" +} + +variable "powervs_cos_storage_class" { + type = string + description = "The plan used for your COS instance" + default = "smart" +} + +################################################################ +# Configure instances +################################################################ +variable "powervs_image_name" { + type = string + description = "Name of the image used by all nodes in the cluster." +} + +variable "powervs_bootstrap_memory" { + type = string + description = "Amount of memory, in GiB, used by the bootstrap node." + default = "32" +} + +variable "powervs_bootstrap_processors" { + type = string + description = "Number of processors used by the bootstrap node." + default = "0.5" +} + +variable "powervs_master_memory" { + type = string + description = "Amount of memory, in GiB, used by each master node." + default = "32" +} + +variable "powervs_master_processors" { + type = string + description = "Number of processors used by each master node." + default = "0.5" +} + +variable "powervs_proc_type" { + type = string + description = "The type of processor mode for all nodes (shared/dedicated)" + default = "shared" +} + +variable "powervs_sys_type" { + type = string + description = "The type of system (s922/e980)" + default = "s922" +} + +variable "powervs_key_name" { + type = string + description = "The name for the SSH key created in the Service Instance" + default = "" +} + +variable "powervs_ssh_key" { + type = string + description = "Public key for keypair used to access cluster. Required when creating 'ibm_pi_instance' resources." + default = "" +} + +################################################################ +# Configure Network Topology +################################################################ +variable "powervs_network_name" { + type = string + description = "Name of the network within the Power VS instance." +} + +variable "powervs_vpc_name" { + type = string + description = "Name of the IBM Cloud Virtual Private Cloud (VPC) to setup the load balancer." +} + +variable "powervs_vpc_subnet_name" { + type = string + description = "Name of the VPC subnet connected via DirectLink to the Power VS private network." +} + +################################################################ +# Configure DNS +################################################################ +## TODO: Pass the CIS CRN from the installer program, refer the IBM Cloud code to see the implementation. +variable "powervs_cis_crn" { + type = string + description = "The CRN of CIS instance to use." +} + diff --git a/go.mod b/go.mod index 47cf60a37a9..a43ec71cba0 100644 --- a/go.mod +++ b/go.mod @@ -66,6 +66,7 @@ require ( github.com/openshift/cluster-api-provider-ibmcloud v0.0.0-20210702173623-676faba9895d github.com/openshift/cluster-api-provider-libvirt v0.2.1-0.20191219173431-2336783d4603 github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20210817084941-2262c7c6cece + github.com/openshift/cluster-api-provider-powervs v0.0.2-0.20210928133618-8eb5ebcb07a1 github.com/openshift/library-go v0.0.0-20210408164723-7a65fdb398e2 github.com/openshift/machine-api-operator v0.2.1-0.20210505133115-b7ef098180db github.com/openshift/machine-config-operator v0.0.0 diff --git a/go.sum b/go.sum index 81fc12a8fd6..af6728dfa61 100644 --- a/go.sum +++ b/go.sum @@ -115,11 +115,13 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/Djarvur/go-err113 v0.0.0-20200511133814-5174e21577d5/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= +github.com/IBM-Cloud/bluemix-go v0.0.0-20200921095234-26d1d0148c62/go.mod h1:gPJbH1etcDj7qS/hBRiLuYW9CY0bRcostSKusa51xR0= github.com/IBM-Cloud/bluemix-go v0.0.0-20210611051827-cdc80c935c05 h1:b/epmuvf99xhUlf81l0r/ciONJSjoUs78t+BC7lCcvI= github.com/IBM-Cloud/bluemix-go v0.0.0-20210611051827-cdc80c935c05/go.mod h1:kqTYO0mts71aa8PVwviaKlCKYud/NbEkFIqU8aHH3/g= github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.5.3/go.mod h1:RiUvKuHKTBmBApDMUQzBL14pQUGKcx/IioKQPIcRQjs= -github.com/IBM-Cloud/power-go-client v1.0.55 h1:XoRU8FWYY8NUKau1nkErkf2FHAUbFEbbXtbLTvaGp9c= github.com/IBM-Cloud/power-go-client v1.0.55/go.mod h1:I4r5tCrA8mV5GFqGAJG4/Tn+/JpR+XLnDCLLNVKJxuI= +github.com/IBM-Cloud/power-go-client v1.0.72 h1:5qoU8JPnFL5dRVR6oimGtAlcnSSDrD9KWs8Co9hAdMs= +github.com/IBM-Cloud/power-go-client v1.0.72/go.mod h1:I4r5tCrA8mV5GFqGAJG4/Tn+/JpR+XLnDCLLNVKJxuI= github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca h1:crniVcf+YcmgF03NmmfonXwSQ73oJF+IohFYBwknMxs= github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca/go.mod h1:IjXrnOcTe92Q4pEBHmui3H/GM1hw5Pd0zXA5cw5/iZU= github.com/IBM/appconfiguration-go-admin-sdk v0.1.0 h1:9rdOk32VQFnMqsBB7cTpkZbD7/b0EnwrU3VNN8vuUYc= @@ -1458,6 +1460,8 @@ github.com/openshift/cluster-api-provider-openstack v0.0.0-20210302164104-849824 github.com/openshift/cluster-api-provider-openstack v0.0.0-20210302164104-8498241fa4bd/go.mod h1:ONl4R7ziQtgnsBjR59fcZbOLjBEPVeZ69C1TPKevynw= github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20210817084941-2262c7c6cece h1:w32C7hy52lkIpDvJqz/tRyYCIZmhE/8bSIVt+L0c9Mg= github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20210817084941-2262c7c6cece/go.mod h1:lrKTKMpd3OERMlQgVJi6VKcE57EvtUORGSFIoE7BEAs= +github.com/openshift/cluster-api-provider-powervs v0.0.2-0.20210928133618-8eb5ebcb07a1 h1:fFRg32p+RR2Li1ynhl74RtSvEFstYEQ+QQufdE6plx8= +github.com/openshift/cluster-api-provider-powervs v0.0.2-0.20210928133618-8eb5ebcb07a1/go.mod h1:J5ynCgpZbdXNBPF9ukQXWeEt5ruMn8BEPSq/h55NfLo= github.com/openshift/cluster-autoscaler-operator v0.0.0-20190521201101-62768a6ba480/go.mod h1:/XmV44Fh28Vo3Ye93qFrxAbcFJ/Uy+7LPD+jGjmfJYc= github.com/openshift/hashicorp-terraform-plugin-sdk v1.14.0-openshift h1:CuH9qNELLH3y0QoSaLchdG+7We75AO4kNBy6P3+oLug= github.com/openshift/hashicorp-terraform-plugin-sdk v1.14.0-openshift/go.mod h1:t62Xy+m7Zjq5tA2vrs8Wuo/TQ0sc9Mx9MjXL3+7MHBQ= @@ -1560,6 +1564,7 @@ github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXq github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/posener/complete/v2 v2.0.1-alpha.12/go.mod h1://JlL91cS2JV7rOl6LVHrRqBXoBUecJu3ILQPgbJiMQ= github.com/posener/script v1.0.4/go.mod h1:Rg3ijooqulo05aGLyGsHoLmIOUzHUVK19WVgrYBPU/E= +github.com/ppc64le-cloud/powervs-utils v0.0.0-20210415051532-4cdd6a79c8fa/go.mod h1:KImYgHmvBVtAczNhyDBDSN54PGIdz0+QiPVQMmObEQY= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/pquerna/ffjson v0.0.0-20181028064349-e517b90714f7/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M= diff --git a/pkg/asset/cluster/tfvars.go b/pkg/asset/cluster/tfvars.go index 6bc5f7edc62..64597e8b8b3 100644 --- a/pkg/asset/cluster/tfvars.go +++ b/pkg/asset/cluster/tfvars.go @@ -603,6 +603,10 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error { Filename: fmt.Sprintf(TfPlatformVarsFileName, platform), Data: data, }) + //case powervs.Name: + // @TODO: Omitting for now to keep PRs seperate as this will pull in + // installconfig, types, and assets + case vsphere.Name: controlPlanes, err := mastersAsset.Machines() if err != nil { diff --git a/pkg/rhcos/powervs_regions.go b/pkg/rhcos/powervs_regions.go new file mode 100644 index 00000000000..66678b1dff4 --- /dev/null +++ b/pkg/rhcos/powervs_regions.go @@ -0,0 +1,86 @@ +package rhcos + +// Since there is no API to query these, we have to hard-code them here. + +// PowerVSRegion describes resources associated with a region in Power VS. +// We're using a few items from the IBM Cloud VPC offering. The region names +// for VPC are different so another function of this is to correlate those. +type PowerVSRegion struct { + Name string + Description string + VPCRegion string + Zones []string +} + +// PowerVSRegions holds the regions for IBM Power VS, and descriptions used during the survey +var PowerVSRegions = map[string]PowerVSRegion{ + "dal": { + Name: "dal", + Description: "Dallas, USA", + VPCRegion: "us-south", + Zones: []string{"dal12"}, + }, + "eu-de": { + Name: "eu-de", + Description: "Frankfurt, Germany", + VPCRegion: "eu-de", + Zones: []string{ + "eu-de-1", + "eu-de-2", + }, + }, + "lon": { + Name: "lon", + Description: "London, UK.", + VPCRegion: "eu-gb", + Zones: []string{ + "lon04", + "lon06", + }, + }, + "osa": { + Name: "osa", + Description: "Osaka, Japan", + VPCRegion: "jp-osa", + Zones: []string{"osa21"}, + }, + "syd": { + Name: "syd", + Description: "Sydney, Australia", + VPCRegion: "au-syd", + Zones: []string{"syd04"}, + }, + "sao": { + Name: "sao", + Description: "São Paulo, Brazil", + VPCRegion: "br-sao", + Zones: []string{"sao01"}, + }, + "tor": { + Name: "tor", + Description: "Toronto, Canada", + VPCRegion: "ca-tor", + Zones: []string{"tor01"}, + }, + "tok": { + Name: "tok", + Description: "Tokyo, Japan", + VPCRegion: "jp-tok", + Zones: []string{"tok04"}, + }, + "us-east": { + Name: "us-east", + Description: "Washington DC, USA", + VPCRegion: "us-east", + Zones: []string{"us-east"}, + }, +} + +// PowerVSZones retrieves a slice of all zones in Power VS +func PowerVSZones() []string { + var zones []string + for _, r := range PowerVSRegions { + zones = append(zones, r.Zones...) + } + return zones +} diff --git a/pkg/terraform/exec/plugins/ibms3presign.go b/pkg/terraform/exec/plugins/ibms3presign.go new file mode 100644 index 00000000000..21a0f742caf --- /dev/null +++ b/pkg/terraform/exec/plugins/ibms3presign.go @@ -0,0 +1,15 @@ +package plugins + +import ( + "github.com/hashicorp/terraform-plugin-sdk/plugin" + "github.com/openshift/installer/pkg/terraform/exec/plugins/ibms3presign" +) + +func init() { + ibmS3PresignProvider := func() { + plugin.Serve(&plugin.ServeOpts{ + ProviderFunc: ibms3presign.Provider, + }) + } + KnownPlugins["terraform-provider-ibms3presign"] = ibmS3PresignProvider +} diff --git a/pkg/terraform/exec/plugins/ibms3presign/provider.go b/pkg/terraform/exec/plugins/ibms3presign/provider.go new file mode 100644 index 00000000000..35a8beef52a --- /dev/null +++ b/pkg/terraform/exec/plugins/ibms3presign/provider.go @@ -0,0 +1,15 @@ +package ibms3presign + +import ( + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +// Provider returns a terraform.ResourceProvider. +func Provider() terraform.ResourceProvider { + return &schema.Provider{ + ResourcesMap: map[string]*schema.Resource{ + "ibms3presign": resourcePresign(), + }, + } +} diff --git a/pkg/terraform/exec/plugins/ibms3presign/resource_presign.go b/pkg/terraform/exec/plugins/ibms3presign/resource_presign.go new file mode 100644 index 00000000000..f780866ce10 --- /dev/null +++ b/pkg/terraform/exec/plugins/ibms3presign/resource_presign.go @@ -0,0 +1,154 @@ +package ibms3presign + +import ( + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +var storageClasses = []string{ + "standard", "vault", "cold", "flex", "smart", +} + +var endpointTypes = []string{ + "public", "private", "direct", +} + +func resourcePresign() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMCOSBucketObjectPresignCreate, + Read: resourceIBMCOSBucketObjectPresignCreate, + Delete: resourceIBMCOSBucketObjectPresignDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "access_key_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Sensitive: true, + Description: "access_key_id", + }, + "secret_access_key": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Sensitive: true, + Description: "secret_access_key", + }, + "bucket_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "COS Bucket name", + }, + "key": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "COS object key", + }, + "region_location": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Region Location info.", + }, + "storage_class": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateAllowedStringValue(storageClasses), + ForceNew: true, + Description: "Storage class info", + }, + "endpoint_type": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validateAllowedStringValue(endpointTypes), + Description: "public, private or direct", + Default: "public", + }, + "presigned_url": { + Type: schema.TypeString, + Computed: true, + Optional: true, + Sensitive: true, + Description: "Presigned URL", + }, + "expire": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Description: "Set expire time for URL in minutes", + Default: 60, + }, + }, + } +} + +func validateAllowedStringValue(validValues []string) schema.SchemaValidateFunc { + return func(v interface{}, k string) (ws []string, errors []error) { + input := v.(string) + existed := false + for _, s := range validValues { + if s == input { + existed = true + break + } + } + if !existed { + errors = append(errors, fmt.Errorf( + "%q must contain a value from %#v, got %q", + k, validValues, input)) + } + return + + } +} + +// resourceIBMCOSBucketObjectPresignDelete is just a placeholder NOP function to satisfy the schema resource +func resourceIBMCOSBucketObjectPresignDelete(d *schema.ResourceData, m interface{}) error { + return nil +} + +func resourceIBMCOSBucketObjectPresignCreate(d *schema.ResourceData, m interface{}) error { + storageClass := d.Get("storage_class").(string) + bucketName := d.Get("bucket_name").(string) + object := d.Get("key").(string) + regionLocation := d.Get("region_location").(string) + endpointType := d.Get("endpoint_type").(string) + accessKey := d.Get("access_key_id").(string) + secretKey := d.Get("secret_access_key").(string) + expire := d.Get("expire").(int) + var svcEndpoint string + if endpointType != "public" { + regionLocation = fmt.Sprintf("%s.%s", endpointType, regionLocation) + } + svcEndpoint = fmt.Sprintf("https://s3.%s.cloud-object-storage.appdomain.cloud", regionLocation) + region := fmt.Sprintf("%s-%s", regionLocation, storageClass) + conf := aws.NewConfig(). + WithRegion(region). + WithEndpoint(svcEndpoint). + WithS3ForcePathStyle(true). + WithCredentials(credentials.NewStaticCredentials(accessKey, secretKey, "")) + sess := session.Must(session.NewSession()) // Creating a new session + client := s3.New(sess, conf) + req, _ := client.GetObjectRequest(&s3.GetObjectInput{ + Bucket: aws.String(bucketName), + Key: aws.String(object), + }) + presignedURL, err := req.Presign(time.Duration(expire) * time.Minute) + if err != nil { + return err + } + d.Set("presigned_url", presignedURL) + d.SetId(fmt.Sprintf("%s/%s", bucketName, object)) + return nil +} diff --git a/pkg/tfvars/powervs/powervs.go b/pkg/tfvars/powervs/powervs.go new file mode 100644 index 00000000000..7f91d9c843a --- /dev/null +++ b/pkg/tfvars/powervs/powervs.go @@ -0,0 +1,90 @@ +// Package powervs contains Power Virtual Servers-specific Terraform-variable logic. +package powervs + +import ( + "encoding/json" + "fmt" + "math/rand" + "time" + + "github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1" + "github.com/openshift/installer/pkg/rhcos" +) + +type config struct { + ServiceInstanceID string `json:"powervs_cloud_instance_id"` + APIKey string `json:"powervs_api_key"` + SSHKey string `json:"powervs_ssh_key"` + PowerVSRegion string `json:"powervs_region"` + PowerVSZone string `json:"powervs_zone"` + VPCRegion string `json:"powervs_vpc_region"` + VPCZone string `json:"powervs_vpc_zone"` + PowerVSResourceGroup string `json:"powervs_resource_group"` + CISInstanceCRN string `json:"powervs_cis_crn"` + ImageName string `json:"powervs_image_name"` + NetworkName string `json:"powervs_network_name"` + VPCName string `json:"powervs_vpc_name"` + VPCSubnetName string `json:"powervs_vpc_subnet_name"` + BootstrapMemory string `json:"powervs_bootstrap_memory"` + BootstrapProcessors string `json:"powervs_bootstrap_processors"` + MasterMemory string `json:"powervs_master_memory"` + MasterProcessors string `json:"powervs_master_processors"` + ProcType string `json:"powervs_proc_type"` + SysType string `json:"powervs_sys_type"` +} + +// TFVarsSources contains the parameters to be converted into Terraform variables +type TFVarsSources struct { + MasterConfigs []*v1alpha1.PowerVSMachineProviderConfig + APIKey string + SSHKey string + Region string + Zone string + NetworkName string + PowerVSResourceGroup string + VPCZone string + CISInstanceCRN string + VPCName string + VPCSubnetName string +} + +// TFVars generates Power VS-specific Terraform variables launching the cluster. +func TFVars(sources TFVarsSources) ([]byte, error) { + masterConfig := sources.MasterConfigs[0] + // TODO(mjturek): Allow user to specify vpcRegion in install config like we're doing for vpcZone + vpcRegion := rhcos.PowerVSRegions[sources.Region].VPCRegion + + vpcZone := sources.VPCZone + if vpcZone == "" { + // Randomly select a zone in the VPC region. + // @TODO: Align this with a region later. + rand.Seed(time.Now().UnixNano()) + // All supported Regions are MZRs and have Zones named "region-[1-3]" + vpcZone = fmt.Sprintf("%s-%d", vpcRegion, rand.Intn(3)) + } + + //@TODO: Add resource group to platform + cfg := &config{ + ServiceInstanceID: masterConfig.ServiceInstanceID, + APIKey: sources.APIKey, + SSHKey: sources.SSHKey, + PowerVSRegion: sources.Region, + PowerVSZone: sources.Zone, + VPCRegion: vpcRegion, + VPCZone: vpcZone, + PowerVSResourceGroup: sources.PowerVSResourceGroup, + CISInstanceCRN: sources.CISInstanceCRN, + ImageName: *masterConfig.Image.Name, + NetworkName: *masterConfig.Network.Name, + VPCName: sources.VPCName, + VPCSubnetName: sources.VPCSubnetName, + BootstrapMemory: masterConfig.Memory, + BootstrapProcessors: masterConfig.Processors, + MasterMemory: masterConfig.Memory, + MasterProcessors: masterConfig.Processors, + ProcType: masterConfig.ProcType, + SysType: masterConfig.SysType, + } + + return json.MarshalIndent(cfg, "", " ") +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-clonevolumes.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-clonevolumes.go index 7f875026779..20f1f71a4ae 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-clonevolumes.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-clonevolumes.go @@ -2,6 +2,8 @@ package instance import ( "fmt" + "github.com/IBM-Cloud/power-go-client/errors" + "log" "time" "github.com/IBM-Cloud/power-go-client/helpers" @@ -28,42 +30,86 @@ func (f *IBMPICloneVolumeClient) Create(cloneParams *p_cloud_volumes.PcloudV2Vol params := p_cloud_volumes.NewPcloudV2VolumesClonePostParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(cloneParams.CloudInstanceID).WithBody(cloneParams.Body) resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesClonePost(params, ibmpisession.NewAuth(f.session, cloneParams.CloudInstanceID)) if err != nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to perform Create operation... %s", err) + return nil, fmt.Errorf(errors.CreateCloneOperationFailed, err) } return resp.Payload, nil } -//DeleteClone Deletes a clone -func (f *IBMPICloneVolumeClient) DeleteClone(cloneParams *p_cloud_volumes.PcloudV2VolumescloneDeleteParams, id, cloudinstance string, timeout time.Duration) (models.Object, error) { - params := p_cloud_volumes.NewPcloudV2VolumescloneDeleteParamsWithTimeout(helpers.PIDeleteTimeOut).WithCloudInstanceID(cloudinstance).WithVolumesCloneID(id) +// Get status of a clone request +func (f *IBMPICloneVolumeClient) Get(powerinstanceid, clonetaskid string, timeout time.Duration) (*models.CloneTaskStatus, error) { + params := p_cloud_volumes.NewPcloudV2VolumesClonetasksGetParamsWithTimeout(helpers.PIGetTimeOut).WithCloudInstanceID(powerinstanceid).WithCloneTaskID(clonetaskid) + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesClonetasksGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) + if err != nil || resp.Payload == nil { + return nil, fmt.Errorf(errors.GetCloneOperationFailed, powerinstanceid, err) + } + return resp.Payload, nil +} - resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneDelete(params, ibmpisession.NewAuth(f.session, cloudinstance)) +// Create a volumes clone V2 Version = This is the prepare operation +func (f *IBMPICloneVolumeClient) CreateV2Clone(powerinstanceid string, cloneparams *p_cloud_volumes.PcloudV2VolumesclonePostParams) (*models.VolumesClone, error) { + params := p_cloud_volumes.NewPcloudV2VolumesclonePostParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithBody(cloneparams.Body) + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesclonePost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) + if err != nil || resp.Payload == nil { + return nil, fmt.Errorf(errors.PrepareCloneOperationFailed, err) + } + return resp.Payload, nil +} + +// Get a list of volume-clones request for a cloud instance +func (f *IBMPICloneVolumeClient) GetV2Clones(powerinstanceid, query_filter string) (*models.VolumesClones, error) { + params := p_cloud_volumes.NewPcloudV2VolumescloneGetallParamsWithTimeout(helpers.PIGetTimeOut).WithCloudInstanceID(powerinstanceid).WithFilter(&query_filter) + log.Printf("the query filter is %s", query_filter) + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneGetall(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to perform Delete operation... %s", err) + return nil, fmt.Errorf(errors.GetCloneOperationFailed, powerinstanceid, err) } return resp.Payload, nil } -// Cancel a Clone +// Delete a volume- clone request +func (f *IBMPICloneVolumeClient) DeleteClone(cloneParams *p_cloud_volumes.PcloudV2VolumescloneDeleteParams, id, cloudinstance string, timeout time.Duration) (models.Object, error) { + params := p_cloud_volumes.NewPcloudV2VolumescloneDeleteParamsWithTimeout(helpers.PIDeleteTimeOut).WithCloudInstanceID(cloudinstance).WithVolumesCloneID(id) + + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneDelete(params, ibmpisession.NewAuth(f.session, cloudinstance)) -// Get status of a clone request -func (f *IBMPICloneVolumeClient) Get(powerinstanceid, clonetaskid string, timeout time.Duration) (*models.CloneTaskStatus, error) { - params := p_cloud_volumes.NewPcloudV2VolumesClonetasksGetParamsWithTimeout(helpers.PIGetTimeOut).WithCloudInstanceID(powerinstanceid).WithCloneTaskID(clonetaskid) - resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesClonetasksGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to perform the get operation for clones... %s", err) + return nil, fmt.Errorf(errors.DeleteCloneOperationFailed, err) } return resp.Payload, nil } -//StartClone ... +// Initiate the start clone request + func (f *IBMPICloneVolumeClient) StartClone(powerinstanceid, volumeCloneID string, timeout time.Duration) (*models.VolumesClone, error) { params := p_cloud_volumes.NewPcloudV2VolumescloneStartPostParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithVolumesCloneID(volumeCloneID) resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneStartPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to perform the start operation for clones... %s", err) + return nil, fmt.Errorf(errors.StartCloneOperationFailed, err) + } + return resp.Payload, nil +} + +// Initiate the execute action for a clone request +func (f *IBMPICloneVolumeClient) PrepareClone(powerinstanceid, volumeCloneID string, timeout time.Duration) (*models.VolumesClone, error) { + params := p_cloud_volumes.NewPcloudV2VolumescloneExecutePostParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithVolumesCloneID(volumeCloneID) + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneExecutePost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) + + if err != nil || resp.Payload == nil { + return nil, fmt.Errorf(errors.PrepareCloneOperationFailed, err) + } + return resp.Payload, nil +} + +// Get V2Clone Task Status + +func (f *IBMPICloneVolumeClient) GetV2CloneStatus(powerinstanceid, clone_name string) (*models.VolumesCloneDetail, error) { + log.Printf("starting the clone status get operation..") + params := p_cloud_volumes.NewPcloudV2VolumescloneGetParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithVolumesCloneID(clone_name) + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) + if err != nil || resp.Payload == nil { + return nil, fmt.Errorf(errors.GetCloneOperationFailed, powerinstanceid, err) } return resp.Payload, nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-connection.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-connection.go index 8366ea42f95..c60b2d74e62 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-connection.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-connection.go @@ -2,6 +2,8 @@ package instance import ( "fmt" + "github.com/IBM-Cloud/power-go-client/errors" + "github.com/IBM-Cloud/power-go-client/helpers" "time" "github.com/IBM-Cloud/power-go-client/ibmpisession" @@ -26,10 +28,10 @@ func NewIBMPICloudConnectionClient(sess *ibmpisession.IBMPISession, powerinstanc // Create a Cloud Connection func (f *IBMPICloudConnectionClient) Create(pclouddef *p_cloud_cloud_connections.PcloudCloudconnectionsPostParams, powerinstanceid string) (*models.CloudConnection, error) { - params := p_cloud_cloud_connections.NewPcloudCloudconnectionsPostParamsWithTimeout(postTimeOut).WithCloudInstanceID(powerinstanceid).WithBody(pclouddef.Body) - postok, postcreated, err, _ := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) + params := p_cloud_cloud_connections.NewPcloudCloudconnectionsPostParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithBody(pclouddef.Body) + postok, postcreated, postAccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil { - return nil, fmt.Errorf("Failed to create cloud connection %s", err) + return nil, fmt.Errorf(errors.CreateCloudConnectionOperationFailed, powerinstanceid, err) } if postok != nil { return postok.Payload, nil @@ -37,32 +39,28 @@ func (f *IBMPICloudConnectionClient) Create(pclouddef *p_cloud_cloud_connections if postcreated != nil { return postcreated.Payload, nil } + + if postAccepted != nil { + return postAccepted.Payload, nil + } return nil, nil } -/* - gets a cloud connection s state information -*/ - // Get ... -func (f *IBMPICloudConnectionClient) Get(pclouddef *p_cloud_cloud_connections.PcloudCloudconnectionsGetParams) (*models.CloudConnection, error) { +func (f *IBMPICloudConnectionClient) Get(cloudinstanceid, cloudconnectionid string) (*models.CloudConnection, error) { - params := p_cloud_cloud_connections.NewPcloudCloudconnectionsGetParams().WithCloudInstanceID(pclouddef.CloudInstanceID).WithCloudConnectionID(pclouddef.CloudConnectionID) - resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsGet(params, ibmpisession.NewAuth(f.session, pclouddef.CloudInstanceID)) + params := p_cloud_cloud_connections.NewPcloudCloudconnectionsGetParamsWithTimeout(helpers.PIGetTimeOut).WithCloudInstanceID(cloudinstanceid).WithCloudConnectionID(cloudconnectionid) + resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsGet(params, ibmpisession.NewAuth(f.session, cloudinstanceid)) if err != nil { - return nil, fmt.Errorf("Failed to get cloud connection %s", err) + return nil, fmt.Errorf(errors.GetCloudConnectionOperationFailed, err) } return resp.Payload, nil } -/* - gets a cloud connection s state information -*/ - // GetAll .. func (f *IBMPICloudConnectionClient) GetAll(powerinstanceid string, timeout time.Duration) (*models.CloudConnections, error) { - params := p_cloud_cloud_connections.NewPcloudCloudconnectionsGetallParamsWithTimeout(timeout).WithCloudInstanceID(powerinstanceid) + params := p_cloud_cloud_connections.NewPcloudCloudconnectionsGetallParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid) resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsGetall(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil { return nil, fmt.Errorf("Failed to get all cloud connection %s", err) @@ -73,54 +71,68 @@ func (f *IBMPICloudConnectionClient) GetAll(powerinstanceid string, timeout time // Update a cloud Connection func (f *IBMPICloudConnectionClient) Update(updateparams *p_cloud_cloud_connections.PcloudCloudconnectionsPutParams) (*models.CloudConnection, error) { - params := p_cloud_cloud_connections.NewPcloudCloudconnectionsPutParams().WithCloudInstanceID(updateparams.CloudInstanceID).WithCloudConnectionID(updateparams.CloudConnectionID).WithBody(updateparams.Body) - resp, err, _ := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsPut(params, ibmpisession.NewAuth(f.session, updateparams.CloudInstanceID)) + params := p_cloud_cloud_connections.NewPcloudCloudconnectionsPutParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(updateparams.CloudInstanceID).WithCloudConnectionID(updateparams.CloudConnectionID).WithBody(updateparams.Body) + _, _, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsPut(params, ibmpisession.NewAuth(f.session, updateparams.CloudInstanceID)) if err != nil { - return nil, fmt.Errorf("Failed to update all cloud connection %s", err) + return nil, fmt.Errorf(errors.UpdateCloudConnectionOperationFailed, updateparams.CloudConnectionID, err) } - return resp.Payload, nil + + return nil, nil } // Delete a Cloud Connection -func (f *IBMPICloudConnectionClient) Delete(pclouddef *p_cloud_cloud_connections.PcloudCloudconnectionsDeleteParams) (models.Object, error) { - params := p_cloud_cloud_connections.NewPcloudCloudconnectionsDeleteParams().WithCloudInstanceID(pclouddef.CloudInstanceID).WithCloudConnectionID(pclouddef.CloudConnectionID) - respok, _, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsDelete(params, ibmpisession.NewAuth(f.session, pclouddef.CloudInstanceID)) +func (f *IBMPICloudConnectionClient) Delete(cloudinstanceid, cloudconnectionid string) (models.Object, error) { + params := p_cloud_cloud_connections.NewPcloudCloudconnectionsDeleteParamsWithTimeout(helpers.PIDeleteTimeOut).WithCloudInstanceID(cloudinstanceid).WithCloudConnectionID(cloudconnectionid) + respok, _, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsDelete(params, ibmpisession.NewAuth(f.session, cloudinstanceid)) - if err != nil || respok.Payload == nil { - return nil, fmt.Errorf("Failed to Delete all cloud connection %s", err) + if err != nil { + return nil, fmt.Errorf(errors.DeleteCloudConnectionOperationFailed, cloudconnectionid, err) } return respok.Payload, nil } // AddNetwork to a cloud connection func (f *IBMPICloudConnectionClient) AddNetwork(pcloudnetworkdef *p_cloud_cloud_connections.PcloudCloudconnectionsNetworksPutParams) (*models.CloudConnection, error) { - params := p_cloud_cloud_connections.NewPcloudCloudconnectionsNetworksPutParams().WithCloudInstanceID(pcloudnetworkdef.CloudInstanceID).WithCloudConnectionID(pcloudnetworkdef.CloudConnectionID).WithNetworkID(pcloudnetworkdef.NetworkID) - resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksPut(params, ibmpisession.NewAuth(f.session, pcloudnetworkdef.CloudInstanceID)) - if err != nil || resp.Payload == nil { + params := p_cloud_cloud_connections.NewPcloudCloudconnectionsNetworksPutParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(pcloudnetworkdef.CloudInstanceID).WithCloudConnectionID(pcloudnetworkdef.CloudConnectionID).WithNetworkID(pcloudnetworkdef.NetworkID) + _, _, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksPut(params, ibmpisession.NewAuth(f.session, pcloudnetworkdef.CloudInstanceID)) + if err != nil { return nil, fmt.Errorf("Failed to add the network to the cloudconnection %s", err) } - return resp.Payload, nil + return nil, nil } // DeleteNetwork Deletes a network from a cloud connection func (f *IBMPICloudConnectionClient) DeleteNetwork(pcloudnetworkdef *p_cloud_cloud_connections.PcloudCloudconnectionsNetworksDeleteParams) (*models.CloudConnection, error) { - params := p_cloud_cloud_connections.NewPcloudCloudconnectionsNetworksDeleteParams().WithCloudInstanceID(pcloudnetworkdef.CloudInstanceID).WithCloudConnectionID(pcloudnetworkdef.CloudConnectionID).WithNetworkID(pcloudnetworkdef.NetworkID) - resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksDelete(params, ibmpisession.NewAuth(f.session, pcloudnetworkdef.CloudInstanceID)) + params := p_cloud_cloud_connections.NewPcloudCloudconnectionsNetworksDeleteParamsWithTimeout(helpers.PIDeleteTimeOut).WithCloudInstanceID(pcloudnetworkdef.CloudInstanceID).WithCloudConnectionID(pcloudnetworkdef.CloudConnectionID).WithNetworkID(pcloudnetworkdef.NetworkID) + _, _, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksDelete(params, ibmpisession.NewAuth(f.session, pcloudnetworkdef.CloudInstanceID)) - if err != nil || resp.Payload == nil { + if err != nil { return nil, fmt.Errorf("Failed to perform the delete operation... %s", err) } - return resp.Payload, nil + return nil, nil } // UpdateNetwork Update a network from a cloud connection func (f *IBMPICloudConnectionClient) UpdateNetwork(pcloudnetworkdef *p_cloud_cloud_connections.PcloudCloudconnectionsNetworksPutParams) (*models.CloudConnection, error) { - params := p_cloud_cloud_connections.NewPcloudCloudconnectionsNetworksPutParams().WithCloudInstanceID(pcloudnetworkdef.CloudInstanceID).WithCloudConnectionID(pcloudnetworkdef.CloudConnectionID).WithNetworkID(pcloudnetworkdef.NetworkID) - resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksPut(params, ibmpisession.NewAuth(f.session, pcloudnetworkdef.CloudInstanceID)) + params := p_cloud_cloud_connections.NewPcloudCloudconnectionsNetworksPutParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(pcloudnetworkdef.CloudInstanceID).WithCloudConnectionID(pcloudnetworkdef.CloudConnectionID).WithNetworkID(pcloudnetworkdef.NetworkID) + resp, _, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksPut(params, ibmpisession.NewAuth(f.session, pcloudnetworkdef.CloudInstanceID)) + + if err != nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to perform the update operation...%v", err) + } + return resp.Payload, nil +} +// get VPCs + +func (f *IBMPICloudConnectionClient) GetVPC(cloudinstanceid string) (*models.CloudConnectionVirtualPrivateClouds, error) { + params := p_cloud_cloud_connections.NewPcloudCloudconnectionsVirtualprivatecloudsGetallParamsWithTimeout(helpers.PIGetTimeOut).WithCloudInstanceID(cloudinstanceid) + + resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsVirtualprivatecloudsGetall(params, ibmpisession.NewAuth(f.session, cloudinstanceid)) if err != nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to perform the update operation... %s", err) + + return nil, fmt.Errorf("failed to perform the getvpc operation...%v", err) } return resp.Payload, nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-instance.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-instance.go index 19068084f73..61d9b91fe12 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-instance.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-instance.go @@ -2,6 +2,7 @@ package instance import ( "fmt" + "github.com/IBM-Cloud/power-go-client/errors" "github.com/IBM-Cloud/power-go-client/ibmpisession" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances" @@ -27,7 +28,7 @@ func (f *IBMPICloudInstanceClient) Get(powerinstanceid string) (*models.CloudIns params := p_cloud_instances.NewPcloudCloudinstancesGetParams().WithCloudInstanceID(powerinstanceid) resp, err := f.session.Power.PCloudInstances.PcloudCloudinstancesGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil { - return nil, fmt.Errorf("Failed to Get Cloud Instance %s: %s", powerinstanceid, err) + return nil, fmt.Errorf(errors.GetCloudInstanceOperationFailed, powerinstanceid, err) } return resp.Payload, nil } @@ -37,7 +38,7 @@ func (f *IBMPICloudInstanceClient) Update(powerinstanceid string, updateparams * params := p_cloud_instances.NewPcloudCloudinstancesPutParamsWithTimeout(f.session.Timeout).WithCloudInstanceID(powerinstanceid).WithBody(updateparams.Body) resp, err := f.session.Power.PCloudInstances.PcloudCloudinstancesPut(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil { - return nil, fmt.Errorf("Failed to Update Cloud Instance %s: %s", powerinstanceid, err) + return nil, fmt.Errorf(errors.UpdateCloudInstanceOperationFailed, powerinstanceid, err) } return resp.Payload, nil @@ -48,7 +49,7 @@ func (f *IBMPICloudInstanceClient) Delete(powerinstanceid string) (models.Object params := p_cloud_instances.NewPcloudCloudinstancesDeleteParams().WithCloudInstanceID(powerinstanceid) resp, err := f.session.Power.PCloudInstances.PcloudCloudinstancesDelete(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to Delete Cloud Instance %s: %s", powerinstanceid, err) + return nil, fmt.Errorf(errors.DeleteCloudInstanceOperationFailed, powerinstanceid, err) } return resp.Payload, nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-image.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-image.go index 3026d906c01..e15996c379c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-image.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-image.go @@ -2,6 +2,7 @@ package instance import ( "fmt" + "github.com/IBM-Cloud/power-go-client/errors" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/ibmpisession" @@ -30,7 +31,7 @@ func (f *IBMPIImageClient) Get(id, powerinstanceid string) (*models.Image, error resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to Get PI Image %s :%s", id, err) + return nil, fmt.Errorf(errors.GetImageOperationFailed, id, err) } return resp.Payload, nil } @@ -59,7 +60,7 @@ func (f *IBMPIImageClient) Create(name, imageid string, powerinstanceid string) params := p_cloud_images.NewPcloudCloudinstancesImagesPostParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithBody(&body) _, result, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || result == nil || result.Payload == nil { - return nil, fmt.Errorf("Failed to Create Image of the PVM instance %s : %s", powerinstanceid, err) + return nil, fmt.Errorf(errors.CreateImageOperationFailed, powerinstanceid, err) } return result.Payload, nil diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-instance.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-instance.go index 10b6276a5d6..0e76c9895d4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-instance.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-instance.go @@ -37,7 +37,7 @@ func (f *IBMPIInstanceClient) Get(id, powerinstanceid string, timeout time.Durat params := p_cloud_p_vm_instances.NewPcloudPvminstancesGetParamsWithTimeout(helpers.PIGetTimeOut).WithCloudInstanceID(powerinstanceid).WithPvmInstanceID(id) resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to Get PVM Instance %s :%s", id, err) + return nil, fmt.Errorf("Failed to Get PVM Instance %s :%v", id, err) } return resp.Payload, nil } @@ -45,10 +45,10 @@ func (f *IBMPIInstanceClient) Get(id, powerinstanceid string, timeout time.Durat // GetAll Information about all the PVM Instances for a Client func (f *IBMPIInstanceClient) GetAll(powerinstanceid string, timeout time.Duration) (*models.PVMInstances, error) { - params := p_cloud_p_vm_instances.NewPcloudPvminstancesGetallParamsWithTimeout(getTimeOut).WithCloudInstanceID(powerinstanceid) + params := p_cloud_p_vm_instances.NewPcloudPvminstancesGetallParamsWithTimeout(helpers.PIGetTimeOut).WithCloudInstanceID(powerinstanceid) resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesGetall(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to Get all PVM Instances of Power Instance %s :%s", powerinstanceid, err) + return nil, fmt.Errorf("Failed to Get all PVM Instances of Power Instance %s :%v", powerinstanceid, err) } return resp.Payload, nil } @@ -60,7 +60,7 @@ func (f *IBMPIInstanceClient) Create(powerdef *p_cloud_p_vm_instances.PcloudPvmi postok, postcreated, postAccepted, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil { - return nil, fmt.Errorf("Failed to Create PVM Instance :%s", err) + return nil, fmt.Errorf("Failed to Create PVM Instance :%v", err) } if postok != nil && len(postok.Payload) > 0 { @@ -163,7 +163,7 @@ func (f *IBMPIInstanceClient) GetSnapShotVM(powerinstanceid, pvminstanceid strin params := p_cloud_p_vm_instances.NewPcloudPvminstancesSnapshotsGetallParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithPvmInstanceID(pvminstanceid) resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesSnapshotsGetall(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to Get the snapshot for the pvminstance [%s]: %s", pvminstanceid, err) + return nil, fmt.Errorf("Failed to Get the snapshot for the pvminstance [%s]: %v", pvminstanceid, err) } return resp.Payload, nil @@ -174,7 +174,7 @@ func (f *IBMPIInstanceClient) RestoreSnapShotVM(powerinstanceid, pvminstanceid, params := p_cloud_p_vm_instances.NewPcloudPvminstancesSnapshotsRestorePostParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithPvmInstanceID(pvminstanceid).WithSnapshotID(snapshotid).WithRestoreFailAction(&restoreAction).WithBody(restoreparams.Body) resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesSnapshotsRestorePost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to restrore the snapshot for the pvminstance [%s]: %s", pvminstanceid, err) + return nil, fmt.Errorf("Failed to restrore the snapshot for the pvminstance [%s]: %v", pvminstanceid, err) } return resp.Payload, nil } @@ -186,7 +186,7 @@ func (f *IBMPIInstanceClient) AddNetwork(powerinstanceid, pvminstanceid string, resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesNetworksPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp.Payload.NetworkID == "" { - return nil, fmt.Errorf("Failed to attach the network to the pvminstanceid %s : %s", pvminstanceid, err) + return nil, fmt.Errorf("Failed to attach the network to the pvminstanceid %s : %v", pvminstanceid, err) } return resp.Payload, nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-key.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-key.go index fc96fd39483..9a22c4318ea 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-key.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-key.go @@ -2,6 +2,8 @@ package instance import ( "fmt" + "github.com/IBM-Cloud/power-go-client/errors" + "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/ibmpisession" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys" @@ -28,11 +30,11 @@ The Power-IAAS API requires the crn to be passed in the header. func (f *IBMPIKeyClient) Get(id, powerinstanceid string) (*models.SSHKey, error) { var tenantid = f.session.UserAccount - params := p_cloud_tenants_ssh_keys.NewPcloudTenantsSshkeysGetParams().WithTenantID(tenantid).WithSshkeyName(id) + params := p_cloud_tenants_ssh_keys.NewPcloudTenantsSshkeysGetParamsWithTimeout(helpers.PIGetTimeOut).WithTenantID(tenantid).WithSshkeyName(id) resp, err := f.session.Power.PCloudTenantsSSHKeys.PcloudTenantsSshkeysGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to Get PI Key %s :%s", id, err) + return nil, fmt.Errorf(errors.GetPIKeyOperationFailed, id, err) } return resp.Payload, nil } @@ -43,10 +45,10 @@ func (f *IBMPIKeyClient) Create(name string, sshkey, powerinstanceid string) (*m Name: &name, SSHKey: &sshkey, } - params := p_cloud_tenants_ssh_keys.NewPcloudTenantsSshkeysPostParamsWithTimeout(f.session.Timeout).WithTenantID(f.session.UserAccount).WithBody(&body) + params := p_cloud_tenants_ssh_keys.NewPcloudTenantsSshkeysPostParamsWithTimeout(helpers.PICreateTimeOut).WithTenantID(f.session.UserAccount).WithBody(&body) _, postok, err := f.session.Power.PCloudTenantsSSHKeys.PcloudTenantsSshkeysPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || postok == nil { - return nil, nil, fmt.Errorf("Failed to Create PI Key %s :%s", name, err) + return nil, nil, fmt.Errorf(errors.CreatePIKeyOperationFailed, name, err) } return nil, postok.Payload, nil @@ -55,10 +57,10 @@ func (f *IBMPIKeyClient) Create(name string, sshkey, powerinstanceid string) (*m // Delete ... func (f *IBMPIKeyClient) Delete(id string, powerinstanceid string) error { var tenantid = f.session.UserAccount - params := p_cloud_tenants_ssh_keys.NewPcloudTenantsSshkeysDeleteParamsWithTimeout(f.session.Timeout).WithTenantID(tenantid).WithSshkeyName(id) + params := p_cloud_tenants_ssh_keys.NewPcloudTenantsSshkeysDeleteParamsWithTimeout(helpers.PIDeleteTimeOut).WithTenantID(tenantid).WithSshkeyName(id) _, err := f.session.Power.PCloudTenantsSSHKeys.PcloudTenantsSshkeysDelete(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil { - return fmt.Errorf("Failed to Delete PI Key %s :%s", id, err) + return fmt.Errorf(errors.DeletePIKeyOperationFailed, id, err) } return nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-network.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-network.go index 3a86e52b2d0..de1dc2f13f0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-network.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-network.go @@ -2,6 +2,7 @@ package instance import ( "fmt" + "github.com/IBM-Cloud/power-go-client/errors" "time" "github.com/IBM-Cloud/power-go-client/ibmpisession" @@ -29,7 +30,7 @@ func (f *IBMPINetworkClient) Get(id, powerinstanceid string, timeout time.Durati resp, err := f.session.Power.PCloudNetworks.PcloudNetworksGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to Get PI Network %s :%s", id, err) + return nil, fmt.Errorf(errors.GetNetworkOperationFailed, id, err) } return resp.Payload, nil } @@ -61,7 +62,7 @@ func (f *IBMPINetworkClient) Create(name string, networktype string, cidr string _, resp, err := f.session.Power.PCloudNetworks.PcloudNetworksPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp == nil || resp.Payload == nil { - return nil, nil, fmt.Errorf("Failed to Create PI Network %s :%s", name, err) + return nil, nil, fmt.Errorf(errors.CreateNetworkOperationFailed, name, err) } return resp.Payload, nil, nil @@ -121,7 +122,7 @@ func (f *IBMPINetworkClient) CreatePort(id string, powerinstanceid string, netwo params := p_cloud_networks.NewPcloudNetworksPortsPostParamsWithTimeout(timeout).WithCloudInstanceID(powerinstanceid).WithNetworkID(id).WithBody(networkportdef.Body) resp, err := f.session.Power.PCloudNetworks.PcloudNetworksPortsPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to create the network port for network %s cloudinstance id [%s]", id, powerinstanceid) + return nil, fmt.Errorf(errors.CreateNetworkPortOperationFailed, id, err) } return resp.Payload, nil } @@ -151,7 +152,7 @@ func (f *IBMPINetworkClient) AttachPort(powerinstanceid, networkID, portID, desc params := p_cloud_networks.NewPcloudNetworksPortsPutParamsWithTimeout(timeout).WithCloudInstanceID(powerinstanceid).WithNetworkID(networkID).WithPortID(portID).WithBody(&body) resp, err := f.session.Power.PCloudNetworks.PcloudNetworksPortsPut(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to attach the port [%s] to network %s the pvminstance [%s]", portID, networkID, pvminstanceid) + return nil, fmt.Errorf(errors.AttachNetworkPortOperationFailed, portID, networkID, err) } return resp.Payload, nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-placement-groups.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-placement-groups.go new file mode 100644 index 00000000000..e650eceec06 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-placement-groups.go @@ -0,0 +1,95 @@ +package instance + +import ( + "fmt" + "github.com/IBM-Cloud/power-go-client/errors" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups" + + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/power-go-client/ibmpisession" + "github.com/IBM-Cloud/power-go-client/power/models" +) + +//IBMPIPlacementGroupClient ... +type IBMPIPlacementGroupClient struct { + session *ibmpisession.IBMPISession + powerinstanceid string +} + +// NewIBMPIImageClient ... +func NewIBMPIPlacementGroupClient(sess *ibmpisession.IBMPISession, powerinstanceid string) *IBMPIPlacementGroupClient { + return &IBMPIPlacementGroupClient{ + session: sess, + powerinstanceid: powerinstanceid, + } +} + +// Get PI Placementgroup +func (f *IBMPIPlacementGroupClient) Get(id, powerinstanceid string) (*models.PlacementGroup, error) { + + params := p_cloud_placement_groups.NewPcloudPlacementgroupsGetParamsWithTimeout(helpers.PIGetTimeOut).WithCloudInstanceID(powerinstanceid).WithPlacementGroupID(id) + resp, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) + + if err != nil { + return nil, fmt.Errorf(errors.GetPlacementGroupOperationFailed, id, err) + } + return resp.Payload, nil +} + +// GEt All placement groups + +func (f *IBMPIPlacementGroupClient) GetAll(powerinstanceid string) (*models.PlacementGroups, error) { + params := p_cloud_placement_groups.NewPcloudPlacementgroupsGetallParamsWithTimeout(helpers.PIGetTimeOut).WithCloudInstanceID(powerinstanceid) + resp, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsGetall(params, ibmpisession.NewAuth(f.session, powerinstanceid)) + + if err != nil { + return nil, fmt.Errorf(errors.GetPlacementGroupOperationFailed, powerinstanceid, err) + } + return resp.Payload, nil +} + +//Create the placement group +func (f *IBMPIPlacementGroupClient) Create(powerdef *p_cloud_placement_groups.PcloudPlacementgroupsPostParams, powerinstanceid string) (*models.PlacementGroup, error) { + + params := p_cloud_placement_groups.NewPcloudPlacementgroupsPostParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithBody(powerdef.Body) + result, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) + if err != nil || result == nil || result.Payload == nil { + return nil, fmt.Errorf(errors.CreatePlacementGroupOperationFailed, powerinstanceid, err) + } + return result.Payload, nil + +} + +// Delete Placement Group +func (f *IBMPIPlacementGroupClient) Delete(id string, powerinstanceid string) error { + params := p_cloud_placement_groups.NewPcloudPlacementgroupsDeleteParamsWithTimeout(helpers.PIDeleteTimeOut).WithCloudInstanceID(powerinstanceid).WithPlacementGroupID(id) + _, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsDelete(params, ibmpisession.NewAuth(f.session, powerinstanceid)) + if err != nil { + return fmt.Errorf(errors.DeletePlacementGroupOperationFailed, id, err) + } + return nil +} + +// Adding a member to a Placement Group +func (f *IBMPIPlacementGroupClient) Update(placementdef *p_cloud_placement_groups.PcloudPlacementgroupsMembersPostParams, placementgroupid, powerinstanceid string) (*models.PlacementGroup, error) { + + params := p_cloud_placement_groups.NewPcloudPlacementgroupsMembersPostParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithPlacementGroupID(placementgroupid).WithBody(placementdef.Body) + resp, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsMembersPost(params, ibmpisession.NewAuth(f.session, f.powerinstanceid)) + + if err != nil { + return nil, fmt.Errorf(errors.UpdatePlacementGroupOperationFailed, powerinstanceid, placementgroupid, err) + } + return resp.Payload, nil +} + +// Delete Member from Placement Group +func (f *IBMPIPlacementGroupClient) DeleteMember(placementdef *p_cloud_placement_groups.PcloudPlacementgroupsMembersPostParams, placementgroupid, powerinstanceid string) (*models.PlacementGroup, error) { + + params := p_cloud_placement_groups.NewPcloudPlacementgroupsMembersDeleteParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithPlacementGroupID(placementgroupid).WithBody(placementdef.Body) + resp, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsMembersDelete(params, ibmpisession.NewAuth(f.session, f.powerinstanceid)) + + if err != nil { + return nil, fmt.Errorf(errors.DeleteMemberPlacementGroupOperationFailed, powerinstanceid, placementgroupid, err) + } + return resp.Payload, nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-storage-capacity.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-storage-capacity.go index 5b8cb269be9..13fb5192dd4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-storage-capacity.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-storage-capacity.go @@ -22,12 +22,43 @@ func NewIBMPIStorageCapacityClient(sess *ibmpisession.IBMPISession, powerinstanc } } -//GetAll information about all the storage pools -func (f *IBMPIStorageCapacityClient) GetAll(powerinstanceid string, timeout time.Duration) (*models.StoragePoolsCapacity, error) { +//Storage capacity for all available storage pools in a region +func (f *IBMPIStorageCapacityClient) GetAllStoragePools(powerinstanceid string, timeout time.Duration) (*models.StoragePoolsCapacity, error) { params := p_cloud_storage_capacity.NewPcloudStoragecapacityPoolsGetallParamsWithTimeout(timeout).WithCloudInstanceID(powerinstanceid) resp, err := f.session.Power.PCloudStorageCapacity.PcloudStoragecapacityPoolsGetall(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to get all storage pools %s", err) + return nil, fmt.Errorf("failed to get all storage pools %v", err) + } + return resp.Payload, nil +} + +// Storage capacity for a storage pool in a region +func (f *IBMPIStorageCapacityClient) GetAvailableStoragePool(powerinstanceid, storagepool string, timeout time.Duration) (*models.StoragePoolCapacity, error) { + params := p_cloud_storage_capacity.NewPcloudStoragecapacityPoolsGetParamsWithTimeout(timeout).WithCloudInstanceID(powerinstanceid).WithStoragePoolName(storagepool) + resp, err := f.session.Power.PCloudStorageCapacity.PcloudStoragecapacityPoolsGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) + + if err != nil || resp.Payload == nil { + fmt.Errorf("failed to get the capacity for storage pool %v", err) + } + return resp.Payload, nil +} + +// Storage capacity for a storage type in a region +func (f *IBMPIStorageCapacityClient) GetAvailableStorageCapacity(powerinstanceid, storage_tier string, timeout time.Duration) (*models.StorageTypeCapacity, error) { + params := p_cloud_storage_capacity.NewPcloudStoragecapacityTypesGetParamsWithTimeout(timeout).WithCloudInstanceID(powerinstanceid).WithStorageTypeName(storage_tier) + resp, err := f.session.Power.PCloudStorageCapacity.PcloudStoragecapacityTypesGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) + if err != nil || resp.Payload == nil { + fmt.Errorf("failed to get the capacity for storage pool %v", err) + } + return resp.Payload, nil +} + +// Storage capacity for all available storage types in a region +func (f *IBMPIStorageCapacityClient) GetAvailableStorageType(powerinstanceid string, timeout time.Duration) (*models.StorageTypesCapacity, error) { + params := p_cloud_storage_capacity.NewPcloudStoragecapacityTypesGetallParamsWithTimeout(timeout).WithCloudInstanceID(powerinstanceid) + resp, err := f.session.Power.PCloudStorageCapacity.PcloudStoragecapacityTypesGetall(params, ibmpisession.NewAuth(f.session, powerinstanceid)) + if err != nil || resp.Payload == nil { + fmt.Errorf("failed to get the capacity for storage tiers %v", err) } return resp.Payload, nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-system-pools.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-system-pools.go index 4b5ab04d988..c8ace83dd13 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-system-pools.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-system-pools.go @@ -2,6 +2,7 @@ package instance import ( "fmt" + "github.com/IBM-Cloud/power-go-client/errors" "github.com/IBM-Cloud/power-go-client/ibmpisession" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools" @@ -27,7 +28,7 @@ func (f *IBMPISystemPoolClient) Get(powerinstanceid string) (models.SystemPools, resp, err := f.session.Power.PCloudSystemPools.PcloudSystempoolsGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to perform get operation... %s", err) + return nil, fmt.Errorf(errors.GetSystemPoolsOperationFailed, powerinstanceid, err) } return resp.Payload, nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-tasks.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-tasks.go index 67261bf87f2..a1eafcdf05b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-tasks.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-tasks.go @@ -3,6 +3,7 @@ package instance import ( "fmt" + "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/ibmpisession" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks" "github.com/IBM-Cloud/power-go-client/power/models" @@ -24,7 +25,7 @@ func NewIBMPITaskClient(sess *ibmpisession.IBMPISession, powerinstanceid string) // Get ... func (f *IBMPITaskClient) Get(id, powerinstanceid string) (*models.Task, error) { - params := p_cloud_tasks.NewPcloudTasksGetParamsWithTimeout(postTimeOut).WithTaskID(id) + params := p_cloud_tasks.NewPcloudTasksGetParamsWithTimeout(helpers.PIGetTimeOut).WithTaskID(id) resp, err := f.session.Power.PCloudTasks.PcloudTasksGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp.Payload == nil { @@ -36,7 +37,7 @@ func (f *IBMPITaskClient) Get(id, powerinstanceid string) (*models.Task, error) // Delete ... func (f *IBMPITaskClient) Delete(id, powerinstanceid string) (models.Object, error) { - params := p_cloud_tasks.NewPcloudTasksDeleteParamsWithTimeout(postTimeOut).WithTaskID(id) + params := p_cloud_tasks.NewPcloudTasksDeleteParamsWithTimeout(helpers.PICreateTimeOut).WithTaskID(id) resp, err := f.session.Power.PCloudTasks.PcloudTasksDelete(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp.Payload == nil { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-volume.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-volume.go index d9e8c58b05e..acb6e2ba923 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-volume.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-volume.go @@ -2,6 +2,7 @@ package instance import ( "fmt" + "github.com/IBM-Cloud/power-go-client/errors" "time" "github.com/IBM-Cloud/power-go-client/helpers" @@ -16,14 +17,6 @@ type IBMPIVolumeClient struct { powerinstanceid string } -const ( - - // Timeouts for power - postTimeOut = 30 * time.Second - getTimeOut = 60 * time.Second - deleteTimeOut = 30 * time.Second -) - // NewIBMPIVolumeClient ... func NewIBMPIVolumeClient(sess *ibmpisession.IBMPISession, powerinstanceid string) *IBMPIVolumeClient { return &IBMPIVolumeClient{ @@ -37,7 +30,7 @@ func (f *IBMPIVolumeClient) Get(id, powerinstanceid string, timeout time.Duratio resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesGet(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to Get PI Volume %s :%s", id, err) + return nil, fmt.Errorf(errors.GetVolumeOperationFailed, id, err) } return resp.Payload, nil } @@ -47,7 +40,7 @@ func (f *IBMPIVolumeClient) CreateVolumeV2(createVolDefs *p_cloud_volumes.Pcloud params := p_cloud_volumes.NewPcloudV2VolumesPostParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithBody(createVolDefs.Body) resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil { - return nil, fmt.Errorf("Failed to Create PI Volume %s :%s", *createVolDefs.Body.Name, err) + return nil, fmt.Errorf(errors.CreateVolumeV2OperationFailed, *createVolDefs.Body.Name, err) } return resp.Payload, nil } @@ -57,7 +50,7 @@ func (f *IBMPIVolumeClient) CreateVolume(createVolDefs *p_cloud_volumes.PcloudCl params := p_cloud_volumes.NewPcloudCloudinstancesVolumesPostParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithBody(createVolDefs.Body) resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to Create PI Instance Volume %s :%s", *createVolDefs.Body.Name, err) + return nil, fmt.Errorf(errors.CreateVolumeOperationFailed, *createVolDefs.Body.Name, err) } return resp.Payload, nil } @@ -67,7 +60,7 @@ func (f *IBMPIVolumeClient) UpdateVolume(updateVolDefs *p_cloud_volumes.PcloudCl params := p_cloud_volumes.NewPcloudCloudinstancesVolumesPutParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithBody(updateVolDefs.Body).WithVolumeID(volumeid) resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesPut(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to Update PI Instance Volume %s :%s", volumeid, err) + return nil, fmt.Errorf(errors.UpdateVolumeOperationFailed, volumeid, err) } return resp.Payload, nil } @@ -77,7 +70,7 @@ func (f *IBMPIVolumeClient) DeleteVolume(id string, powerinstanceid string, time params := p_cloud_volumes.NewPcloudCloudinstancesVolumesDeleteParamsWithTimeout(helpers.PIDeleteTimeOut).WithCloudInstanceID(powerinstanceid).WithVolumeID(id) _, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesDelete(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil { - return fmt.Errorf("Failed to Delete PI Instance Volume %s :%s", id, err) + return fmt.Errorf(errors.DeleteVolumeOperationFailed, id, err) } return nil } @@ -96,7 +89,7 @@ func (f *IBMPIVolumeClient) Create(volumename string, volumesize float64, volume params := p_cloud_volumes.NewPcloudCloudinstancesVolumesPostParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithBody(&body) resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to Create PI Instance Volume %s :%s", volumename, err) + return nil, fmt.Errorf(errors.CreateVolumeOperationFailed, volumename, err) } return resp.Payload, nil } @@ -107,7 +100,7 @@ func (f *IBMPIVolumeClient) Delete(id string, powerinstanceid string, timeout ti params := p_cloud_volumes.NewPcloudCloudinstancesVolumesDeleteParamsWithTimeout(helpers.PIDeleteTimeOut).WithCloudInstanceID(powerinstanceid).WithVolumeID(id) _, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesDelete(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil { - return fmt.Errorf("Failed to Delete PI Instance Volume %s :%s", id, err) + return fmt.Errorf(errors.DeleteVolumeOperationFailed, id, err) } return nil } @@ -129,7 +122,7 @@ func (f *IBMPIVolumeClient) Update(id, volumename string, volumesize float64, vo params := p_cloud_volumes.NewPcloudCloudinstancesVolumesPutParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithVolumeID(id).WithBody(&patchbody) resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesPut(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to Update PI Instance Volume %s :%s", id, err) + return nil, fmt.Errorf(errors.UpdateVolumeOperationFailed, id, err) } return resp.Payload, nil } @@ -139,7 +132,7 @@ func (f *IBMPIVolumeClient) Attach(id, volumename string, powerinstanceid string params := p_cloud_volumes.NewPcloudPvminstancesVolumesPostParamsWithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(powerinstanceid).WithPvmInstanceID(id).WithVolumeID(volumename) resp, err := f.session.Power.PCloudVolumes.PcloudPvminstancesVolumesPost(params, ibmpisession.NewAuth(f.session, powerinstanceid)) if err != nil || resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("Failed to Attach PI Instance Volume %s :%s", id, err) + return nil, fmt.Errorf(errors.AttachVolumeOperationFailed, id, err) } return resp.Payload, nil diff --git a/vendor/github.com/IBM-Cloud/power-go-client/errors/errors.go b/vendor/github.com/IBM-Cloud/power-go-client/errors/errors.go new file mode 100644 index 00000000000..14ad3b69b0a --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/errors/errors.go @@ -0,0 +1,137 @@ +package errors + +import ( + "encoding/json" + "reflect" + //"strconv" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// start of Placementgroup Messages + +const GetPlacementGroupOperationFailed = "failed to perform Get Placement Group Operation for placement group %s with error %v" +const CreatePlacementGroupOperationFailed = "failed to perform Create Placement Group Operation for powerinstanceid %s with error %v" +const DeletePlacementGroupOperationFailed = "failed to perform Delete Placement Group Operation for placement group %s with error %v" +const UpdatePlacementGroupOperationFailed = "failed to perform Update Placement Group Operation for powerinstanceid %s and placement group %s with error %v" +const DeleteMemberPlacementGroupOperationFailed = "failed to perform Delete Placement Group Operation for powerinstanceid %s and placement group %s with error %v" + +// start of Cloud Connection Messages + +const GetCloudConnectionOperationFailed = "failed to perform Get Cloud Connections Operation for powerinstanceid %s with error %v" +const CreateCloudConnectionOperationFailed = "failed to perform Create Cloud Connection Operation for powerinstanceid %s with error %v" +const UpdateCloudConnectionOperationFailed = "failed to perform Update Cloud Connection Operation for cloudconnectionid %s with error %v" +const DeleteCloudConnectionOperationFailed = "failed to perform Delete Cloud Connection Operation for cloudconnectionid %s with error %v" + +// start of System-Pools Messages +const GetSystemPoolsOperationFailed = "failed to perform Get System Pools Operation for powerinstanceid %s with error %v" + +// start of Image Messages + +const GetImageOperationFailed = "failed to perform Get Image Operation for image %s with error %v" +const CreateImageOperationFailed = "failed to perform Create Image Operation for powerinstanceid %s with error %v" + +// Start of Network Messages +const GetNetworkOperationFailed = "failed to perform Get Network Operation for Network id %s with error %v" +const CreateNetworkOperationFailed = "failed to perform Create Network Operation for Network %s with error %v" +const CreateNetworkPortOperationFailed = "failed to perform Create Network Port Operation for Network %s with error %v" +const AttachNetworkPortOperationFailed = "failed to perform Attach Network Port Operation for Port %s to Network %s with error %v" + +// start of Volume Messages +const DeleteVolumeOperationFailed = "failed to perform Delete Volume Operation for volume %s with error %v" +const UpdateVolumeOperationFailed = "failed to perform Update Volume Operation for volume %s with error %v" +const GetVolumeOperationFailed = "failed to perform the Get Volume Operation for volume %s with error %v" +const CreateVolumeOperationFailed = "failed to perform the Create volume Operation for volume %s with error %v" +const CreateVolumeV2OperationFailed = "failed to perform the Create volume Operation V2 for volume %s with error %v" +const AttachVolumeOperationFailed = "failed to perform the Attach volume Operation for volume %s with error %v" + +// start of Clone Messages +const StartCloneOperationFailed = "failed to start the clone operation for %v" +const PrepareCloneOperationFailed = "failed to prepare the clone operation for %v" +const DeleteCloneOperationFailed = "failed to perform Delete operation %v" +const GetCloneOperationFailed = "failed to get the volumes-clone for the power instanceid %s with error %v" +const CreateCloneOperationFailed = "failed to perform the create clone operation %v" + +// start of Cloud Instance Messages +const GetCloudInstanceOperationFailed = "failed to Get Cloud Instance %s with error %v" +const UpdateCloudInstanceOperationFailed = "failed to update the Cloud instance %s with error %v" +const DeleteCloudInstanceOperationFailed = "failed to delete the Cloud instance %s with error %v" + +// start of PI Key Messages +const GetPIKeyOperationFailed = "failed to Get PI Key %s with error %v" +const CreatePIKeyOperationFailed = "failed to Create PI Key %s with error %v" +const DeletePIKeyOperationFailed = "failed to Delete PI Key %s with error %v" + +// ErrorTarget ... +type ErrorTarget struct { + Name string + Type string +} + +// SingleError ... +type SingleError struct { + Code string + Message string + MoreInfo string + Target ErrorTarget +} + +// PowerError ... +type Error struct { + Payload *models.Error +} + +func (e Error) Error() string { + b, _ := json.Marshal(e.Payload) + return string(b) +} + +// ToError ... +func ToError(err error) error { + if err == nil { + return nil + } + + // check if its ours + kind := reflect.TypeOf(err).Kind() + if kind != reflect.Ptr { + return err + } + + // next follow pointer + errstruct := reflect.TypeOf(err).Elem() + if errstruct.Kind() != reflect.Struct { + return err + } + + n := errstruct.NumField() + found := false + for i := 0; i < n; i++ { + if errstruct.Field(i).Name == "Payload" { + found = true + break + } + } + + if !found { + return err + } + + // check if a payload field exists + payloadValue := reflect.ValueOf(err).Elem().FieldByName("Payload") + if payloadValue.Interface() == nil { + return err + } + + payloadIntf := payloadValue.Elem().Interface() + payload, parsed := payloadIntf.(models.Error) + if !parsed { + return err + } + + var reterr = Error{ + Payload: &payload, + } + + return reterr +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/helpers/constants.go b/vendor/github.com/IBM-Cloud/power-go-client/helpers/constants.go index 000f47b8c71..92542175777 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/helpers/constants.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/helpers/constants.go @@ -5,32 +5,35 @@ import "time" const ( // IBM PI Instance - PIInstanceName = "pi_instance_name" - PIInstanceDate = "pi_creation_date" - PIInstanceSSHKeyName = "pi_key_pair_name" - PIInstanceImageName = "pi_image_id" - PIInstanceProcessors = "pi_processors" - PIInstanceProcType = "pi_proc_type" - PIInstanceMemory = "pi_memory" - PIInstanceSystemType = "pi_sys_type" - PIInstanceId = "pi_instance_id" - PIInstanceDiskSize = "pi_disk_size" - PIInstanceStatus = "pi_instance_status" - PIInstanceMinProc = "pi_minproc" - PIInstanceVolumeIds = "pi_volume_ids" - PIInstanceNetworkIds = "pi_network_ids" - PIInstancePublicNetwork = "pi_public_network" - PIInstanceMigratable = "pi_migratable" - PICloudInstanceId = "pi_cloud_instance_id" - PICloudInstanceSubnetName = "pi_cloud_instance_subnet_name" - PIInstanceMimMem = "pi_minmem" - PIInstanceMaxProc = "pi_maxproc" - PIInstanceMaxMem = "pi_maxmem" - PIInstanceReboot = "pi_reboot" - PITenantId = "pi_tenant_id" - PIVirtualCoresAssigned = "pi_virtual_cores_assigned" - PIVirtualCoresMax = "pi_virtual_cores_max" - PIVirtualCoresMin = "pi_virutal_cores_min" + PIInstanceName = "pi_instance_name" + PIInstanceDate = "pi_creation_date" + PIInstanceSSHKeyName = "pi_key_pair_name" + PIInstanceImageName = "pi_image_id" + PIInstanceProcessors = "pi_processors" + PIInstanceProcType = "pi_proc_type" + PIInstanceMemory = "pi_memory" + PIInstanceSystemType = "pi_sys_type" + PIInstanceId = "pi_instance_id" + PIInstanceDiskSize = "pi_disk_size" + PIInstanceStatus = "pi_instance_status" + PIInstanceMinProc = "pi_minproc" + PIInstanceVolumeIds = "pi_volume_ids" + PIInstanceNetworkIds = "pi_network_ids" + PIInstancePublicNetwork = "pi_public_network" + PIInstanceMigratable = "pi_migratable" + PICloudInstanceId = "pi_cloud_instance_id" + PICloudInstanceSubnetName = "pi_cloud_instance_subnet_name" + PIInstanceMimMem = "pi_minmem" + PIInstanceMaxProc = "pi_maxproc" + PIInstanceMaxMem = "pi_maxmem" + PIInstanceReboot = "pi_reboot" + PITenantId = "pi_tenant_id" + PIVirtualCoresAssigned = "pi_virtual_cores_assigned" + PIVirtualCoresMax = "pi_virtual_cores_max" + PIVirtualCoresMin = "pi_virtual_cores_min" + PIInstancePVMNetwork = "pi_instance_pvm_network" + PIInstanceStoragePool = "pi_instance_storage_pool" + PIInstanceStorageAffinityPool = "pi_instance_storage_affinity_pool" PIInstanceHealthStatus = "pi_health_status" PIInstanceReplicants = "pi_replicants" @@ -54,6 +57,10 @@ const ( PIVolumePool = "pi_volume_pool" PIAffinityPolicy = "pi_volume_affinity_policy" PIAffinityVolume = "pi_volume_affinity" + PIAffinityInstance = "pi_volume_affinity_instance" + PIAffinityDiskCount = "pi_volume_disk_count" + PIStoragePoolValue = "pi_storage_pool_type" + PIStoragePoolName = "pi_storage_pool_name" // IBM PI Snapshots @@ -63,6 +70,20 @@ const ( PISnapshotAction = "pi_snap_shot_action" PISnapshotComplete = "pi_snap_shot_complete" + // IBM PI SAP Profile + + PISAPProfileID = "pi_sap_profile_id" + PISAPProfile = "pi_sap_profile" + PISAPProfileMemory = "pi_sap_profile_memory" + PISAPProfileCertified = "pi_sap_profile_certified" + PISAPProfileType = "pi_sap_profile_type" + PISAPProfileCores = "pi_sap_profile_cores" + + // IBM PI Clone Volume + PIVolumeCloneStatus = "pi_volume_clone_status" + PIVolumeClonePercent = "pi_volume_clone_percent" + PIVolumeCloneFailure = "pi_volume_clone_failure" + // IBM PI Image PIImageName = "pi_image_name" @@ -125,6 +146,25 @@ const ( PIInstanceCaptureCloudStorageAccessKey = "pi_capture_cloud_storage_access_key" PIInstanceCaptureCloudStorageSecretKey = "pi_capture_cloud_storage_secret_key" + // IBM PI Cloud Connections + + PICloudConnectionsName = "pi_cloud_connection_name" + PICloudConnectionStatus = "pi_cloud_connection_status" + PICloudConnectionMetered = "pi_cloud_connection_metered" + PICloudConnectionUserIPAddress = "pi_cloud_connection_user_ip_address" + PICloudConnectionIBMIPAddress = "pi_cloud_connection_ibm_ip_address" + PICloudConnectionSpeed = "pi_cloud_connection_speed" + PICloudConnectionPort = "pi_cloud_connection_port" + PICloudConnectionGlobalRouting = "pi_global_routing" + PICloudConnectionId = "pi_cloud_connection_id" + PICloudConnectionClassic = "pi_cloud_connection_classic" + + // IBM PI Placement Groups + + PIPlacementGroupName = "pi_placement_group_name" + PIPlacementGroupPolicy = "pi_placement_group_policy" + PIPlacementGroupID = "pi_placement_group_id" + // Status For all the resources PIVolumeDeleting = "deleting" diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go index dbb88b41b57..6cf9dc61c8a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go @@ -120,7 +120,7 @@ func (a *Client) PcloudCloudconnectionsGetall(params *PcloudCloudconnectionsGeta /* PcloudCloudconnectionsNetworksDelete deletes a network from a cloud connection */ -func (a *Client) PcloudCloudconnectionsNetworksDelete(params *PcloudCloudconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsNetworksDeleteOK, error) { +func (a *Client) PcloudCloudconnectionsNetworksDelete(params *PcloudCloudconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsNetworksDeleteOK, *PcloudCloudconnectionsNetworksDeleteAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudconnectionsNetworksDeleteParams() @@ -140,45 +140,22 @@ func (a *Client) PcloudCloudconnectionsNetworksDelete(params *PcloudCloudconnect Client: params.HTTPClient, }) if err != nil { - return nil, err - } - return result.(*PcloudCloudconnectionsNetworksDeleteOK), nil - -} - -/* -PcloudCloudconnectionsNetworksGet gets information about a cloud connections attached network -*/ -func (a *Client) PcloudCloudconnectionsNetworksGet(params *PcloudCloudconnectionsNetworksGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsNetworksGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudconnectionsNetworksGetParams() + return nil, nil, err } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.cloudconnections.networks.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudconnectionsNetworksGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err + switch value := result.(type) { + case *PcloudCloudconnectionsNetworksDeleteOK: + return value, nil, nil + case *PcloudCloudconnectionsNetworksDeleteAccepted: + return nil, value, nil } - return result.(*PcloudCloudconnectionsNetworksGetOK), nil + return nil, nil, nil } /* PcloudCloudconnectionsNetworksPut adds a network to the cloud connection */ -func (a *Client) PcloudCloudconnectionsNetworksPut(params *PcloudCloudconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsNetworksPutOK, error) { +func (a *Client) PcloudCloudconnectionsNetworksPut(params *PcloudCloudconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsNetworksPutOK, *PcloudCloudconnectionsNetworksPutAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudconnectionsNetworksPutParams() @@ -198,9 +175,15 @@ func (a *Client) PcloudCloudconnectionsNetworksPut(params *PcloudCloudconnection Client: params.HTTPClient, }) if err != nil { - return nil, err + return nil, nil, err + } + switch value := result.(type) { + case *PcloudCloudconnectionsNetworksPutOK: + return value, nil, nil + case *PcloudCloudconnectionsNetworksPutAccepted: + return nil, value, nil } - return result.(*PcloudCloudconnectionsNetworksPutOK), nil + return nil, nil, nil } @@ -277,7 +260,7 @@ func (a *Client) PcloudCloudconnectionsPut(params *PcloudCloudconnectionsPutPara } /* -PcloudCloudconnectionsVirtualprivatecloudsGetall gets all cloud connections in this cloud instance +PcloudCloudconnectionsVirtualprivatecloudsGetall gets all virtual private cloud connections in this cloud instance */ func (a *Client) PcloudCloudconnectionsVirtualprivatecloudsGetall(params *PcloudCloudconnectionsVirtualprivatecloudsGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsVirtualprivatecloudsGetallOK, error) { // TODO: Validate the params before sending diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go index 392d4aa5a2a..902093064af 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go @@ -46,6 +46,13 @@ func (o *PcloudCloudconnectionsDeleteReader) ReadResponse(response runtime.Clien } return nil, result + case 401: + result := NewPcloudCloudconnectionsDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: result := NewPcloudCloudconnectionsDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -148,6 +155,35 @@ func (o *PcloudCloudconnectionsDeleteBadRequest) readResponse(response runtime.C return nil } +// NewPcloudCloudconnectionsDeleteUnauthorized creates a PcloudCloudconnectionsDeleteUnauthorized with default headers values +func NewPcloudCloudconnectionsDeleteUnauthorized() *PcloudCloudconnectionsDeleteUnauthorized { + return &PcloudCloudconnectionsDeleteUnauthorized{} +} + +/*PcloudCloudconnectionsDeleteUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudconnectionsDeleteUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudconnectionsDeleteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudconnectionsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudconnectionsDeleteGone creates a PcloudCloudconnectionsDeleteGone with default headers values func NewPcloudCloudconnectionsDeleteGone() *PcloudCloudconnectionsDeleteGone { return &PcloudCloudconnectionsDeleteGone{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go index df1a91e221e..52b0f7e391c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudconnectionsGetReader) ReadResponse(response runtime.ClientRe } return nil, result + case 401: + result := NewPcloudCloudconnectionsGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudCloudconnectionsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudCloudconnectionsGetBadRequest) readResponse(response runtime.Clie return nil } +// NewPcloudCloudconnectionsGetUnauthorized creates a PcloudCloudconnectionsGetUnauthorized with default headers values +func NewPcloudCloudconnectionsGetUnauthorized() *PcloudCloudconnectionsGetUnauthorized { + return &PcloudCloudconnectionsGetUnauthorized{} +} + +/*PcloudCloudconnectionsGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudconnectionsGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudconnectionsGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudconnectionsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudconnectionsGetNotFound creates a PcloudCloudconnectionsGetNotFound with default headers values func NewPcloudCloudconnectionsGetNotFound() *PcloudCloudconnectionsGetNotFound { return &PcloudCloudconnectionsGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go index bf3befbd472..ddb4087584a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudconnectionsGetallReader) ReadResponse(response runtime.Clien } return nil, result + case 401: + result := NewPcloudCloudconnectionsGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudCloudconnectionsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -109,6 +116,35 @@ func (o *PcloudCloudconnectionsGetallBadRequest) readResponse(response runtime.C return nil } +// NewPcloudCloudconnectionsGetallUnauthorized creates a PcloudCloudconnectionsGetallUnauthorized with default headers values +func NewPcloudCloudconnectionsGetallUnauthorized() *PcloudCloudconnectionsGetallUnauthorized { + return &PcloudCloudconnectionsGetallUnauthorized{} +} + +/*PcloudCloudconnectionsGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudconnectionsGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudconnectionsGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudconnectionsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudconnectionsGetallInternalServerError creates a PcloudCloudconnectionsGetallInternalServerError with default headers values func NewPcloudCloudconnectionsGetallInternalServerError() *PcloudCloudconnectionsGetallInternalServerError { return &PcloudCloudconnectionsGetallInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go index 88cef00aa28..eec64a15656 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go @@ -32,6 +32,13 @@ func (o *PcloudCloudconnectionsNetworksDeleteReader) ReadResponse(response runti } return result, nil + case 202: + result := NewPcloudCloudconnectionsNetworksDeleteAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: result := NewPcloudCloudconnectionsNetworksDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -39,6 +46,13 @@ func (o *PcloudCloudconnectionsNetworksDeleteReader) ReadResponse(response runti } return nil, result + case 401: + result := NewPcloudCloudconnectionsNetworksDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: result := NewPcloudCloudconnectionsNetworksDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -87,6 +101,33 @@ func (o *PcloudCloudconnectionsNetworksDeleteOK) readResponse(response runtime.C return nil } +// NewPcloudCloudconnectionsNetworksDeleteAccepted creates a PcloudCloudconnectionsNetworksDeleteAccepted with default headers values +func NewPcloudCloudconnectionsNetworksDeleteAccepted() *PcloudCloudconnectionsNetworksDeleteAccepted { + return &PcloudCloudconnectionsNetworksDeleteAccepted{} +} + +/*PcloudCloudconnectionsNetworksDeleteAccepted handles this case with default header values. + +Accepted +*/ +type PcloudCloudconnectionsNetworksDeleteAccepted struct { + Payload models.Object +} + +func (o *PcloudCloudconnectionsNetworksDeleteAccepted) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteAccepted %+v", 202, o.Payload) +} + +func (o *PcloudCloudconnectionsNetworksDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudconnectionsNetworksDeleteBadRequest creates a PcloudCloudconnectionsNetworksDeleteBadRequest with default headers values func NewPcloudCloudconnectionsNetworksDeleteBadRequest() *PcloudCloudconnectionsNetworksDeleteBadRequest { return &PcloudCloudconnectionsNetworksDeleteBadRequest{} @@ -116,6 +157,35 @@ func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) readResponse(response r return nil } +// NewPcloudCloudconnectionsNetworksDeleteUnauthorized creates a PcloudCloudconnectionsNetworksDeleteUnauthorized with default headers values +func NewPcloudCloudconnectionsNetworksDeleteUnauthorized() *PcloudCloudconnectionsNetworksDeleteUnauthorized { + return &PcloudCloudconnectionsNetworksDeleteUnauthorized{} +} + +/*PcloudCloudconnectionsNetworksDeleteUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudconnectionsNetworksDeleteUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudconnectionsNetworksDeleteGone creates a PcloudCloudconnectionsNetworksDeleteGone with default headers values func NewPcloudCloudconnectionsNetworksDeleteGone() *PcloudCloudconnectionsNetworksDeleteGone { return &PcloudCloudconnectionsNetworksDeleteGone{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_get_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_get_parameters.go deleted file mode 100644 index bf4756c494b..00000000000 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_get_parameters.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudconnectionsNetworksGetParams creates a new PcloudCloudconnectionsNetworksGetParams object -// with the default values initialized. -func NewPcloudCloudconnectionsNetworksGetParams() *PcloudCloudconnectionsNetworksGetParams { - var () - return &PcloudCloudconnectionsNetworksGetParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudconnectionsNetworksGetParamsWithTimeout creates a new PcloudCloudconnectionsNetworksGetParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewPcloudCloudconnectionsNetworksGetParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsNetworksGetParams { - var () - return &PcloudCloudconnectionsNetworksGetParams{ - - timeout: timeout, - } -} - -// NewPcloudCloudconnectionsNetworksGetParamsWithContext creates a new PcloudCloudconnectionsNetworksGetParams object -// with the default values initialized, and the ability to set a context for a request -func NewPcloudCloudconnectionsNetworksGetParamsWithContext(ctx context.Context) *PcloudCloudconnectionsNetworksGetParams { - var () - return &PcloudCloudconnectionsNetworksGetParams{ - - Context: ctx, - } -} - -// NewPcloudCloudconnectionsNetworksGetParamsWithHTTPClient creates a new PcloudCloudconnectionsNetworksGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewPcloudCloudconnectionsNetworksGetParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsNetworksGetParams { - var () - return &PcloudCloudconnectionsNetworksGetParams{ - HTTPClient: client, - } -} - -/*PcloudCloudconnectionsNetworksGetParams contains all the parameters to send to the API endpoint -for the pcloud cloudconnections networks get operation typically these are written to a http.Request -*/ -type PcloudCloudconnectionsNetworksGetParams struct { - - /*CloudConnectionID - Cloud Connection ID - - */ - CloudConnectionID string - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance - - */ - CloudInstanceID string - /*NetworkID - Network ID - - */ - NetworkID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the pcloud cloudconnections networks get params -func (o *PcloudCloudconnectionsNetworksGetParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsNetworksGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudconnections networks get params -func (o *PcloudCloudconnectionsNetworksGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudconnections networks get params -func (o *PcloudCloudconnectionsNetworksGetParams) WithContext(ctx context.Context) *PcloudCloudconnectionsNetworksGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudconnections networks get params -func (o *PcloudCloudconnectionsNetworksGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudconnections networks get params -func (o *PcloudCloudconnectionsNetworksGetParams) WithHTTPClient(client *http.Client) *PcloudCloudconnectionsNetworksGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudconnections networks get params -func (o *PcloudCloudconnectionsNetworksGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudConnectionID adds the cloudConnectionID to the pcloud cloudconnections networks get params -func (o *PcloudCloudconnectionsNetworksGetParams) WithCloudConnectionID(cloudConnectionID string) *PcloudCloudconnectionsNetworksGetParams { - o.SetCloudConnectionID(cloudConnectionID) - return o -} - -// SetCloudConnectionID adds the cloudConnectionId to the pcloud cloudconnections networks get params -func (o *PcloudCloudconnectionsNetworksGetParams) SetCloudConnectionID(cloudConnectionID string) { - o.CloudConnectionID = cloudConnectionID -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudconnections networks get params -func (o *PcloudCloudconnectionsNetworksGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudconnectionsNetworksGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudconnections networks get params -func (o *PcloudCloudconnectionsNetworksGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithNetworkID adds the networkID to the pcloud cloudconnections networks get params -func (o *PcloudCloudconnectionsNetworksGetParams) WithNetworkID(networkID string) *PcloudCloudconnectionsNetworksGetParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the pcloud cloudconnections networks get params -func (o *PcloudCloudconnectionsNetworksGetParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudconnectionsNetworksGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_connection_id - if err := r.SetPathParam("cloud_connection_id", o.CloudConnectionID); err != nil { - return err - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_get_responses.go deleted file mode 100644 index b39dcbfc610..00000000000 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_get_responses.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudconnectionsNetworksGetReader is a Reader for the PcloudCloudconnectionsNetworksGet structure. -type PcloudCloudconnectionsNetworksGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsNetworksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewPcloudCloudconnectionsNetworksGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - case 400: - result := NewPcloudCloudconnectionsNetworksGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - case 404: - result := NewPcloudCloudconnectionsNetworksGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - case 500: - result := NewPcloudCloudconnectionsNetworksGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewPcloudCloudconnectionsNetworksGetOK creates a PcloudCloudconnectionsNetworksGetOK with default headers values -func NewPcloudCloudconnectionsNetworksGetOK() *PcloudCloudconnectionsNetworksGetOK { - return &PcloudCloudconnectionsNetworksGetOK{} -} - -/*PcloudCloudconnectionsNetworksGetOK handles this case with default header values. - -OK -*/ -type PcloudCloudconnectionsNetworksGetOK struct { - Payload *models.Network -} - -func (o *PcloudCloudconnectionsNetworksGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksGetOK %+v", 200, o.Payload) -} - -func (o *PcloudCloudconnectionsNetworksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Network) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksGetBadRequest creates a PcloudCloudconnectionsNetworksGetBadRequest with default headers values -func NewPcloudCloudconnectionsNetworksGetBadRequest() *PcloudCloudconnectionsNetworksGetBadRequest { - return &PcloudCloudconnectionsNetworksGetBadRequest{} -} - -/*PcloudCloudconnectionsNetworksGetBadRequest handles this case with default header values. - -Bad Request -*/ -type PcloudCloudconnectionsNetworksGetBadRequest struct { - Payload *models.Error -} - -func (o *PcloudCloudconnectionsNetworksGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksGetBadRequest %+v", 400, o.Payload) -} - -func (o *PcloudCloudconnectionsNetworksGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksGetNotFound creates a PcloudCloudconnectionsNetworksGetNotFound with default headers values -func NewPcloudCloudconnectionsNetworksGetNotFound() *PcloudCloudconnectionsNetworksGetNotFound { - return &PcloudCloudconnectionsNetworksGetNotFound{} -} - -/*PcloudCloudconnectionsNetworksGetNotFound handles this case with default header values. - -Not Found -*/ -type PcloudCloudconnectionsNetworksGetNotFound struct { - Payload *models.Error -} - -func (o *PcloudCloudconnectionsNetworksGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksGetNotFound %+v", 404, o.Payload) -} - -func (o *PcloudCloudconnectionsNetworksGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksGetInternalServerError creates a PcloudCloudconnectionsNetworksGetInternalServerError with default headers values -func NewPcloudCloudconnectionsNetworksGetInternalServerError() *PcloudCloudconnectionsNetworksGetInternalServerError { - return &PcloudCloudconnectionsNetworksGetInternalServerError{} -} - -/*PcloudCloudconnectionsNetworksGetInternalServerError handles this case with default header values. - -Internal Server Error -*/ -type PcloudCloudconnectionsNetworksGetInternalServerError struct { - Payload *models.Error -} - -func (o *PcloudCloudconnectionsNetworksGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksGetInternalServerError %+v", 500, o.Payload) -} - -func (o *PcloudCloudconnectionsNetworksGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go index 8406a663c4f..64bf139cf4a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go @@ -32,6 +32,13 @@ func (o *PcloudCloudconnectionsNetworksPutReader) ReadResponse(response runtime. } return result, nil + case 202: + result := NewPcloudCloudconnectionsNetworksPutAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: result := NewPcloudCloudconnectionsNetworksPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -39,6 +46,13 @@ func (o *PcloudCloudconnectionsNetworksPutReader) ReadResponse(response runtime. } return nil, result + case 401: + result := NewPcloudCloudconnectionsNetworksPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: result := NewPcloudCloudconnectionsNetworksPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -87,6 +101,33 @@ func (o *PcloudCloudconnectionsNetworksPutOK) readResponse(response runtime.Clie return nil } +// NewPcloudCloudconnectionsNetworksPutAccepted creates a PcloudCloudconnectionsNetworksPutAccepted with default headers values +func NewPcloudCloudconnectionsNetworksPutAccepted() *PcloudCloudconnectionsNetworksPutAccepted { + return &PcloudCloudconnectionsNetworksPutAccepted{} +} + +/*PcloudCloudconnectionsNetworksPutAccepted handles this case with default header values. + +Accepted +*/ +type PcloudCloudconnectionsNetworksPutAccepted struct { + Payload models.Object +} + +func (o *PcloudCloudconnectionsNetworksPutAccepted) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutAccepted %+v", 202, o.Payload) +} + +func (o *PcloudCloudconnectionsNetworksPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudconnectionsNetworksPutBadRequest creates a PcloudCloudconnectionsNetworksPutBadRequest with default headers values func NewPcloudCloudconnectionsNetworksPutBadRequest() *PcloudCloudconnectionsNetworksPutBadRequest { return &PcloudCloudconnectionsNetworksPutBadRequest{} @@ -116,6 +157,35 @@ func (o *PcloudCloudconnectionsNetworksPutBadRequest) readResponse(response runt return nil } +// NewPcloudCloudconnectionsNetworksPutUnauthorized creates a PcloudCloudconnectionsNetworksPutUnauthorized with default headers values +func NewPcloudCloudconnectionsNetworksPutUnauthorized() *PcloudCloudconnectionsNetworksPutUnauthorized { + return &PcloudCloudconnectionsNetworksPutUnauthorized{} +} + +/*PcloudCloudconnectionsNetworksPutUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudconnectionsNetworksPutUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudconnectionsNetworksPutUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudconnectionsNetworksPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudconnectionsNetworksPutUnprocessableEntity creates a PcloudCloudconnectionsNetworksPutUnprocessableEntity with default headers values func NewPcloudCloudconnectionsNetworksPutUnprocessableEntity() *PcloudCloudconnectionsNetworksPutUnprocessableEntity { return &PcloudCloudconnectionsNetworksPutUnprocessableEntity{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go index 61bb04049a8..9f63a4e9f32 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go @@ -53,6 +53,13 @@ func (o *PcloudCloudconnectionsPostReader) ReadResponse(response runtime.ClientR } return nil, result + case 401: + result := NewPcloudCloudconnectionsPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudCloudconnectionsPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -195,6 +202,35 @@ func (o *PcloudCloudconnectionsPostBadRequest) readResponse(response runtime.Cli return nil } +// NewPcloudCloudconnectionsPostUnauthorized creates a PcloudCloudconnectionsPostUnauthorized with default headers values +func NewPcloudCloudconnectionsPostUnauthorized() *PcloudCloudconnectionsPostUnauthorized { + return &PcloudCloudconnectionsPostUnauthorized{} +} + +/*PcloudCloudconnectionsPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudconnectionsPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudconnectionsPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudconnectionsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudconnectionsPostConflict creates a PcloudCloudconnectionsPostConflict with default headers values func NewPcloudCloudconnectionsPostConflict() *PcloudCloudconnectionsPostConflict { return &PcloudCloudconnectionsPostConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go index c7ec47ff39d..1cb11463a79 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go @@ -46,6 +46,27 @@ func (o *PcloudCloudconnectionsPutReader) ReadResponse(response runtime.ClientRe } return nil, result + case 401: + result := NewPcloudCloudconnectionsPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 404: + result := NewPcloudCloudconnectionsPutNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 405: + result := NewPcloudCloudconnectionsPutMethodNotAllowed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: result := NewPcloudCloudconnectionsPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -104,7 +125,7 @@ func NewPcloudCloudconnectionsPutAccepted() *PcloudCloudconnectionsPutAccepted { Accepted */ type PcloudCloudconnectionsPutAccepted struct { - Payload *models.CloudConnection + Payload models.Object } func (o *PcloudCloudconnectionsPutAccepted) Error() string { @@ -113,10 +134,8 @@ func (o *PcloudCloudconnectionsPutAccepted) Error() string { func (o *PcloudCloudconnectionsPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.CloudConnection) - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } @@ -152,6 +171,93 @@ func (o *PcloudCloudconnectionsPutBadRequest) readResponse(response runtime.Clie return nil } +// NewPcloudCloudconnectionsPutUnauthorized creates a PcloudCloudconnectionsPutUnauthorized with default headers values +func NewPcloudCloudconnectionsPutUnauthorized() *PcloudCloudconnectionsPutUnauthorized { + return &PcloudCloudconnectionsPutUnauthorized{} +} + +/*PcloudCloudconnectionsPutUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudconnectionsPutUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudconnectionsPutUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudconnectionsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudCloudconnectionsPutNotFound creates a PcloudCloudconnectionsPutNotFound with default headers values +func NewPcloudCloudconnectionsPutNotFound() *PcloudCloudconnectionsPutNotFound { + return &PcloudCloudconnectionsPutNotFound{} +} + +/*PcloudCloudconnectionsPutNotFound handles this case with default header values. + +Not Found +*/ +type PcloudCloudconnectionsPutNotFound struct { + Payload *models.Error +} + +func (o *PcloudCloudconnectionsPutNotFound) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutNotFound %+v", 404, o.Payload) +} + +func (o *PcloudCloudconnectionsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudCloudconnectionsPutMethodNotAllowed creates a PcloudCloudconnectionsPutMethodNotAllowed with default headers values +func NewPcloudCloudconnectionsPutMethodNotAllowed() *PcloudCloudconnectionsPutMethodNotAllowed { + return &PcloudCloudconnectionsPutMethodNotAllowed{} +} + +/*PcloudCloudconnectionsPutMethodNotAllowed handles this case with default header values. + +Method Not Allowed +*/ +type PcloudCloudconnectionsPutMethodNotAllowed struct { + Payload *models.Error +} + +func (o *PcloudCloudconnectionsPutMethodNotAllowed) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutMethodNotAllowed %+v", 405, o.Payload) +} + +func (o *PcloudCloudconnectionsPutMethodNotAllowed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudconnectionsPutUnprocessableEntity creates a PcloudCloudconnectionsPutUnprocessableEntity with default headers values func NewPcloudCloudconnectionsPutUnprocessableEntity() *PcloudCloudconnectionsPutUnprocessableEntity { return &PcloudCloudconnectionsPutUnprocessableEntity{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go index 41e0bfca491..971f611f48a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallReader) ReadResponse(re } return nil, result + case 401: + result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -109,6 +116,35 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) readRespons return nil } +// NewPcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized creates a PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized with default headers values +func NewPcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized() *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized { + return &PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized{} +} + +/*PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError creates a PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError with default headers values func NewPcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError() *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError { return &PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_responses.go index 795d78c34f4..0285dc7a2c9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudEventsGetReader) ReadResponse(response runtime.ClientResponse, co } return nil, result + case 401: + result := NewPcloudEventsGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudEventsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudEventsGetBadRequest) readResponse(response runtime.ClientResponse return nil } +// NewPcloudEventsGetUnauthorized creates a PcloudEventsGetUnauthorized with default headers values +func NewPcloudEventsGetUnauthorized() *PcloudEventsGetUnauthorized { + return &PcloudEventsGetUnauthorized{} +} + +/*PcloudEventsGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudEventsGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudEventsGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudEventsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudEventsGetNotFound creates a PcloudEventsGetNotFound with default headers values func NewPcloudEventsGetNotFound() *PcloudEventsGetNotFound { return &PcloudEventsGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_responses.go index 40cfbd3423e..f6087864019 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_responses.go @@ -39,6 +39,13 @@ func (o *PcloudEventsGetqueryReader) ReadResponse(response runtime.ClientRespons } return nil, result + case 401: + result := NewPcloudEventsGetqueryUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudEventsGetqueryInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -109,6 +116,35 @@ func (o *PcloudEventsGetqueryBadRequest) readResponse(response runtime.ClientRes return nil } +// NewPcloudEventsGetqueryUnauthorized creates a PcloudEventsGetqueryUnauthorized with default headers values +func NewPcloudEventsGetqueryUnauthorized() *PcloudEventsGetqueryUnauthorized { + return &PcloudEventsGetqueryUnauthorized{} +} + +/*PcloudEventsGetqueryUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudEventsGetqueryUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudEventsGetqueryUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudEventsGetqueryUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudEventsGetqueryInternalServerError creates a PcloudEventsGetqueryInternalServerError with default headers values func NewPcloudEventsGetqueryInternalServerError() *PcloudEventsGetqueryInternalServerError { return &PcloudEventsGetqueryInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go index 0be0ba32059..180ec1184de 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesImagesDeleteReader) ReadResponse(response runtime.C } return nil, result + case 401: + result := NewPcloudCloudinstancesImagesDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: result := NewPcloudCloudinstancesImagesDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +121,35 @@ func (o *PcloudCloudinstancesImagesDeleteBadRequest) readResponse(response runti return nil } +// NewPcloudCloudinstancesImagesDeleteUnauthorized creates a PcloudCloudinstancesImagesDeleteUnauthorized with default headers values +func NewPcloudCloudinstancesImagesDeleteUnauthorized() *PcloudCloudinstancesImagesDeleteUnauthorized { + return &PcloudCloudinstancesImagesDeleteUnauthorized{} +} + +/*PcloudCloudinstancesImagesDeleteUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesImagesDeleteUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesImagesDeleteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesImagesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesImagesDeleteGone creates a PcloudCloudinstancesImagesDeleteGone with default headers values func NewPcloudCloudinstancesImagesDeleteGone() *PcloudCloudinstancesImagesDeleteGone { return &PcloudCloudinstancesImagesDeleteGone{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go index 215635c358b..91a3ad90c93 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesImagesExportPostReader) ReadResponse(response runti } return nil, result + case 401: + result := NewPcloudCloudinstancesImagesExportPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudCloudinstancesImagesExportPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +121,35 @@ func (o *PcloudCloudinstancesImagesExportPostBadRequest) readResponse(response r return nil } +// NewPcloudCloudinstancesImagesExportPostUnauthorized creates a PcloudCloudinstancesImagesExportPostUnauthorized with default headers values +func NewPcloudCloudinstancesImagesExportPostUnauthorized() *PcloudCloudinstancesImagesExportPostUnauthorized { + return &PcloudCloudinstancesImagesExportPostUnauthorized{} +} + +/*PcloudCloudinstancesImagesExportPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesImagesExportPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesImagesExportPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesImagesExportPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesImagesExportPostNotFound creates a PcloudCloudinstancesImagesExportPostNotFound with default headers values func NewPcloudCloudinstancesImagesExportPostNotFound() *PcloudCloudinstancesImagesExportPostNotFound { return &PcloudCloudinstancesImagesExportPostNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go index da20793f5fb..eafde453889 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesImagesGetReader) ReadResponse(response runtime.Clie } return nil, result + case 401: + result := NewPcloudCloudinstancesImagesGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudCloudinstancesImagesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudCloudinstancesImagesGetBadRequest) readResponse(response runtime. return nil } +// NewPcloudCloudinstancesImagesGetUnauthorized creates a PcloudCloudinstancesImagesGetUnauthorized with default headers values +func NewPcloudCloudinstancesImagesGetUnauthorized() *PcloudCloudinstancesImagesGetUnauthorized { + return &PcloudCloudinstancesImagesGetUnauthorized{} +} + +/*PcloudCloudinstancesImagesGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesImagesGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesImagesGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesImagesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesImagesGetNotFound creates a PcloudCloudinstancesImagesGetNotFound with default headers values func NewPcloudCloudinstancesImagesGetNotFound() *PcloudCloudinstancesImagesGetNotFound { return &PcloudCloudinstancesImagesGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go index fffd794fee8..02b4454c780 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesImagesGetallReader) ReadResponse(response runtime.C } return nil, result + case 401: + result := NewPcloudCloudinstancesImagesGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudCloudinstancesImagesGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudCloudinstancesImagesGetallBadRequest) readResponse(response runti return nil } +// NewPcloudCloudinstancesImagesGetallUnauthorized creates a PcloudCloudinstancesImagesGetallUnauthorized with default headers values +func NewPcloudCloudinstancesImagesGetallUnauthorized() *PcloudCloudinstancesImagesGetallUnauthorized { + return &PcloudCloudinstancesImagesGetallUnauthorized{} +} + +/*PcloudCloudinstancesImagesGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesImagesGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesImagesGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesImagesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesImagesGetallNotFound creates a PcloudCloudinstancesImagesGetallNotFound with default headers values func NewPcloudCloudinstancesImagesGetallNotFound() *PcloudCloudinstancesImagesGetallNotFound { return &PcloudCloudinstancesImagesGetallNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go index 9ec57afbacf..14254d376d5 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go @@ -46,6 +46,13 @@ func (o *PcloudCloudinstancesImagesPostReader) ReadResponse(response runtime.Cli } return nil, result + case 401: + result := NewPcloudCloudinstancesImagesPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudCloudinstancesImagesPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -159,6 +166,35 @@ func (o *PcloudCloudinstancesImagesPostBadRequest) readResponse(response runtime return nil } +// NewPcloudCloudinstancesImagesPostUnauthorized creates a PcloudCloudinstancesImagesPostUnauthorized with default headers values +func NewPcloudCloudinstancesImagesPostUnauthorized() *PcloudCloudinstancesImagesPostUnauthorized { + return &PcloudCloudinstancesImagesPostUnauthorized{} +} + +/*PcloudCloudinstancesImagesPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesImagesPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesImagesPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesImagesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesImagesPostConflict creates a PcloudCloudinstancesImagesPostConflict with default headers values func NewPcloudCloudinstancesImagesPostConflict() *PcloudCloudinstancesImagesPostConflict { return &PcloudCloudinstancesImagesPostConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go index 564aad9675f..bbb04327a76 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesStockimagesGetReader) ReadResponse(response runtime } return nil, result + case 401: + result := NewPcloudCloudinstancesStockimagesGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudCloudinstancesStockimagesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudCloudinstancesStockimagesGetBadRequest) readResponse(response run return nil } +// NewPcloudCloudinstancesStockimagesGetUnauthorized creates a PcloudCloudinstancesStockimagesGetUnauthorized with default headers values +func NewPcloudCloudinstancesStockimagesGetUnauthorized() *PcloudCloudinstancesStockimagesGetUnauthorized { + return &PcloudCloudinstancesStockimagesGetUnauthorized{} +} + +/*PcloudCloudinstancesStockimagesGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesStockimagesGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesStockimagesGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesStockimagesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesStockimagesGetNotFound creates a PcloudCloudinstancesStockimagesGetNotFound with default headers values func NewPcloudCloudinstancesStockimagesGetNotFound() *PcloudCloudinstancesStockimagesGetNotFound { return &PcloudCloudinstancesStockimagesGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_parameters.go index ea73e175e52..52f1f03cfdf 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_parameters.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_parameters.go @@ -72,6 +72,11 @@ type PcloudCloudinstancesStockimagesGetallParams struct { */ Sap *bool + /*Vtl + Include VTL images with get available stock images + + */ + Vtl *bool timeout time.Duration Context context.Context @@ -133,6 +138,17 @@ func (o *PcloudCloudinstancesStockimagesGetallParams) SetSap(sap *bool) { o.Sap = sap } +// WithVtl adds the vtl to the pcloud cloudinstances stockimages getall params +func (o *PcloudCloudinstancesStockimagesGetallParams) WithVtl(vtl *bool) *PcloudCloudinstancesStockimagesGetallParams { + o.SetVtl(vtl) + return o +} + +// SetVtl adds the vtl to the pcloud cloudinstances stockimages getall params +func (o *PcloudCloudinstancesStockimagesGetallParams) SetVtl(vtl *bool) { + o.Vtl = vtl +} + // WriteToRequest writes these params to a swagger request func (o *PcloudCloudinstancesStockimagesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -162,6 +178,22 @@ func (o *PcloudCloudinstancesStockimagesGetallParams) WriteToRequest(r runtime.C } + if o.Vtl != nil { + + // query param vtl + var qrVtl bool + if o.Vtl != nil { + qrVtl = *o.Vtl + } + qVtl := swag.FormatBool(qrVtl) + if qVtl != "" { + if err := r.SetQueryParam("vtl", qVtl); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go index 58dee5af645..30af9166131 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesStockimagesGetallReader) ReadResponse(response runt } return nil, result + case 401: + result := NewPcloudCloudinstancesStockimagesGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudCloudinstancesStockimagesGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudCloudinstancesStockimagesGetallBadRequest) readResponse(response return nil } +// NewPcloudCloudinstancesStockimagesGetallUnauthorized creates a PcloudCloudinstancesStockimagesGetallUnauthorized with default headers values +func NewPcloudCloudinstancesStockimagesGetallUnauthorized() *PcloudCloudinstancesStockimagesGetallUnauthorized { + return &PcloudCloudinstancesStockimagesGetallUnauthorized{} +} + +/*PcloudCloudinstancesStockimagesGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesStockimagesGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesStockimagesGetallNotFound creates a PcloudCloudinstancesStockimagesGetallNotFound with default headers values func NewPcloudCloudinstancesStockimagesGetallNotFound() *PcloudCloudinstancesStockimagesGetallNotFound { return &PcloudCloudinstancesStockimagesGetallNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_responses.go index 1e32b1daeb9..a9bd635b89e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudImagesGetReader) ReadResponse(response runtime.ClientResponse, co } return nil, result + case 401: + result := NewPcloudImagesGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudImagesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudImagesGetBadRequest) readResponse(response runtime.ClientResponse return nil } +// NewPcloudImagesGetUnauthorized creates a PcloudImagesGetUnauthorized with default headers values +func NewPcloudImagesGetUnauthorized() *PcloudImagesGetUnauthorized { + return &PcloudImagesGetUnauthorized{} +} + +/*PcloudImagesGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudImagesGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudImagesGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudImagesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudImagesGetNotFound creates a PcloudImagesGetNotFound with default headers values func NewPcloudImagesGetNotFound() *PcloudImagesGetNotFound { return &PcloudImagesGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_parameters.go index b9a55a57994..0de7385b0ce 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_parameters.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_parameters.go @@ -67,6 +67,11 @@ type PcloudImagesGetallParams struct { */ Sap *bool + /*Vtl + Include VTL images with get available stock images + + */ + Vtl *bool timeout time.Duration Context context.Context @@ -117,6 +122,17 @@ func (o *PcloudImagesGetallParams) SetSap(sap *bool) { o.Sap = sap } +// WithVtl adds the vtl to the pcloud images getall params +func (o *PcloudImagesGetallParams) WithVtl(vtl *bool) *PcloudImagesGetallParams { + o.SetVtl(vtl) + return o +} + +// SetVtl adds the vtl to the pcloud images getall params +func (o *PcloudImagesGetallParams) SetVtl(vtl *bool) { + o.Vtl = vtl +} + // WriteToRequest writes these params to a swagger request func (o *PcloudImagesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -141,6 +157,22 @@ func (o *PcloudImagesGetallParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.Vtl != nil { + + // query param vtl + var qrVtl bool + if o.Vtl != nil { + qrVtl = *o.Vtl + } + qVtl := swag.FormatBool(qrVtl) + if qVtl != "" { + if err := r.SetQueryParam("vtl", qVtl); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_responses.go index 9b5b595a587..242dc4a0cad 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudImagesGetallReader) ReadResponse(response runtime.ClientResponse, } return nil, result + case 401: + result := NewPcloudImagesGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudImagesGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudImagesGetallBadRequest) readResponse(response runtime.ClientRespo return nil } +// NewPcloudImagesGetallUnauthorized creates a PcloudImagesGetallUnauthorized with default headers values +func NewPcloudImagesGetallUnauthorized() *PcloudImagesGetallUnauthorized { + return &PcloudImagesGetallUnauthorized{} +} + +/*PcloudImagesGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudImagesGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudImagesGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudImagesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudImagesGetallNotFound creates a PcloudImagesGetallNotFound with default headers values func NewPcloudImagesGetallNotFound() *PcloudImagesGetallNotFound { return &PcloudImagesGetallNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go index 83d4b62ad5b..c9d968005bf 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesDeleteReader) ReadResponse(response runtime.ClientR } return nil, result + case 401: + result := NewPcloudCloudinstancesDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: result := NewPcloudCloudinstancesDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +121,35 @@ func (o *PcloudCloudinstancesDeleteBadRequest) readResponse(response runtime.Cli return nil } +// NewPcloudCloudinstancesDeleteUnauthorized creates a PcloudCloudinstancesDeleteUnauthorized with default headers values +func NewPcloudCloudinstancesDeleteUnauthorized() *PcloudCloudinstancesDeleteUnauthorized { + return &PcloudCloudinstancesDeleteUnauthorized{} +} + +/*PcloudCloudinstancesDeleteUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesDeleteUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesDeleteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesDeleteGone creates a PcloudCloudinstancesDeleteGone with default headers values func NewPcloudCloudinstancesDeleteGone() *PcloudCloudinstancesDeleteGone { return &PcloudCloudinstancesDeleteGone{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go index a485801dfcb..c2e7517d654 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesGetReader) ReadResponse(response runtime.ClientResp } return nil, result + case 401: + result := NewPcloudCloudinstancesGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudCloudinstancesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudCloudinstancesGetBadRequest) readResponse(response runtime.Client return nil } +// NewPcloudCloudinstancesGetUnauthorized creates a PcloudCloudinstancesGetUnauthorized with default headers values +func NewPcloudCloudinstancesGetUnauthorized() *PcloudCloudinstancesGetUnauthorized { + return &PcloudCloudinstancesGetUnauthorized{} +} + +/*PcloudCloudinstancesGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesGetNotFound creates a PcloudCloudinstancesGetNotFound with default headers values func NewPcloudCloudinstancesGetNotFound() *PcloudCloudinstancesGetNotFound { return &PcloudCloudinstancesGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go index bbe76c87699..8e7cdbc3950 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesPutReader) ReadResponse(response runtime.ClientResp } return nil, result + case 401: + result := NewPcloudCloudinstancesPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: result := NewPcloudCloudinstancesPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudCloudinstancesPutBadRequest) readResponse(response runtime.Client return nil } +// NewPcloudCloudinstancesPutUnauthorized creates a PcloudCloudinstancesPutUnauthorized with default headers values +func NewPcloudCloudinstancesPutUnauthorized() *PcloudCloudinstancesPutUnauthorized { + return &PcloudCloudinstancesPutUnauthorized{} +} + +/*PcloudCloudinstancesPutUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesPutUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesPutUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesPutUnprocessableEntity creates a PcloudCloudinstancesPutUnprocessableEntity with default headers values func NewPcloudCloudinstancesPutUnprocessableEntity() *PcloudCloudinstancesPutUnprocessableEntity { return &PcloudCloudinstancesPutUnprocessableEntity{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_responses.go index cdd74b11a60..75172ea3fdd 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_responses.go @@ -39,6 +39,13 @@ func (o *PcloudNetworksDeleteReader) ReadResponse(response runtime.ClientRespons } return nil, result + case 401: + result := NewPcloudNetworksDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: result := NewPcloudNetworksDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +121,35 @@ func (o *PcloudNetworksDeleteBadRequest) readResponse(response runtime.ClientRes return nil } +// NewPcloudNetworksDeleteUnauthorized creates a PcloudNetworksDeleteUnauthorized with default headers values +func NewPcloudNetworksDeleteUnauthorized() *PcloudNetworksDeleteUnauthorized { + return &PcloudNetworksDeleteUnauthorized{} +} + +/*PcloudNetworksDeleteUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudNetworksDeleteUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudNetworksDeleteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudNetworksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudNetworksDeleteGone creates a PcloudNetworksDeleteGone with default headers values func NewPcloudNetworksDeleteGone() *PcloudNetworksDeleteGone { return &PcloudNetworksDeleteGone{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_responses.go index c7e324eefe4..13369bee455 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudNetworksGetReader) ReadResponse(response runtime.ClientResponse, } return nil, result + case 401: + result := NewPcloudNetworksGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudNetworksGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudNetworksGetBadRequest) readResponse(response runtime.ClientRespon return nil } +// NewPcloudNetworksGetUnauthorized creates a PcloudNetworksGetUnauthorized with default headers values +func NewPcloudNetworksGetUnauthorized() *PcloudNetworksGetUnauthorized { + return &PcloudNetworksGetUnauthorized{} +} + +/*PcloudNetworksGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudNetworksGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudNetworksGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudNetworksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudNetworksGetNotFound creates a PcloudNetworksGetNotFound with default headers values func NewPcloudNetworksGetNotFound() *PcloudNetworksGetNotFound { return &PcloudNetworksGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_responses.go index 937d60735c1..21c3d2a47f4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudNetworksGetallReader) ReadResponse(response runtime.ClientRespons } return nil, result + case 401: + result := NewPcloudNetworksGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudNetworksGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -109,6 +116,35 @@ func (o *PcloudNetworksGetallBadRequest) readResponse(response runtime.ClientRes return nil } +// NewPcloudNetworksGetallUnauthorized creates a PcloudNetworksGetallUnauthorized with default headers values +func NewPcloudNetworksGetallUnauthorized() *PcloudNetworksGetallUnauthorized { + return &PcloudNetworksGetallUnauthorized{} +} + +/*PcloudNetworksGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudNetworksGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudNetworksGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudNetworksGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudNetworksGetallInternalServerError creates a PcloudNetworksGetallInternalServerError with default headers values func NewPcloudNetworksGetallInternalServerError() *PcloudNetworksGetallInternalServerError { return &PcloudNetworksGetallInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go index 33c7d083f1e..38da0c6c60f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go @@ -39,6 +39,13 @@ func (o *PcloudNetworksPortsDeleteReader) ReadResponse(response runtime.ClientRe } return nil, result + case 401: + result := NewPcloudNetworksPortsDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: result := NewPcloudNetworksPortsDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +121,35 @@ func (o *PcloudNetworksPortsDeleteBadRequest) readResponse(response runtime.Clie return nil } +// NewPcloudNetworksPortsDeleteUnauthorized creates a PcloudNetworksPortsDeleteUnauthorized with default headers values +func NewPcloudNetworksPortsDeleteUnauthorized() *PcloudNetworksPortsDeleteUnauthorized { + return &PcloudNetworksPortsDeleteUnauthorized{} +} + +/*PcloudNetworksPortsDeleteUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudNetworksPortsDeleteUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudNetworksPortsDeleteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudNetworksPortsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudNetworksPortsDeleteGone creates a PcloudNetworksPortsDeleteGone with default headers values func NewPcloudNetworksPortsDeleteGone() *PcloudNetworksPortsDeleteGone { return &PcloudNetworksPortsDeleteGone{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go index db7482dd4f1..d41c736d160 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go @@ -32,6 +32,13 @@ func (o *PcloudNetworksPortsGetReader) ReadResponse(response runtime.ClientRespo } return result, nil + case 401: + result := NewPcloudNetworksPortsGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudNetworksPortsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -80,6 +87,35 @@ func (o *PcloudNetworksPortsGetOK) readResponse(response runtime.ClientResponse, return nil } +// NewPcloudNetworksPortsGetUnauthorized creates a PcloudNetworksPortsGetUnauthorized with default headers values +func NewPcloudNetworksPortsGetUnauthorized() *PcloudNetworksPortsGetUnauthorized { + return &PcloudNetworksPortsGetUnauthorized{} +} + +/*PcloudNetworksPortsGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudNetworksPortsGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudNetworksPortsGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudNetworksPortsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudNetworksPortsGetNotFound creates a PcloudNetworksPortsGetNotFound with default headers values func NewPcloudNetworksPortsGetNotFound() *PcloudNetworksPortsGetNotFound { return &PcloudNetworksPortsGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go index 0b290baf809..174f34a00f4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudNetworksPortsGetallReader) ReadResponse(response runtime.ClientRe } return nil, result + case 401: + result := NewPcloudNetworksPortsGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudNetworksPortsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -109,6 +116,35 @@ func (o *PcloudNetworksPortsGetallBadRequest) readResponse(response runtime.Clie return nil } +// NewPcloudNetworksPortsGetallUnauthorized creates a PcloudNetworksPortsGetallUnauthorized with default headers values +func NewPcloudNetworksPortsGetallUnauthorized() *PcloudNetworksPortsGetallUnauthorized { + return &PcloudNetworksPortsGetallUnauthorized{} +} + +/*PcloudNetworksPortsGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudNetworksPortsGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudNetworksPortsGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudNetworksPortsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudNetworksPortsGetallInternalServerError creates a PcloudNetworksPortsGetallInternalServerError with default headers values func NewPcloudNetworksPortsGetallInternalServerError() *PcloudNetworksPortsGetallInternalServerError { return &PcloudNetworksPortsGetallInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go index cba7f8237d1..fc2881e2a68 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudNetworksPortsPostReader) ReadResponse(response runtime.ClientResp } return nil, result + case 401: + result := NewPcloudNetworksPortsPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudNetworksPortsPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -123,6 +130,35 @@ func (o *PcloudNetworksPortsPostBadRequest) readResponse(response runtime.Client return nil } +// NewPcloudNetworksPortsPostUnauthorized creates a PcloudNetworksPortsPostUnauthorized with default headers values +func NewPcloudNetworksPortsPostUnauthorized() *PcloudNetworksPortsPostUnauthorized { + return &PcloudNetworksPortsPostUnauthorized{} +} + +/*PcloudNetworksPortsPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudNetworksPortsPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudNetworksPortsPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudNetworksPortsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudNetworksPortsPostConflict creates a PcloudNetworksPortsPostConflict with default headers values func NewPcloudNetworksPortsPostConflict() *PcloudNetworksPortsPostConflict { return &PcloudNetworksPortsPostConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go index 05d0c3325d4..c801e5f8855 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go @@ -39,6 +39,13 @@ func (o *PcloudNetworksPortsPutReader) ReadResponse(response runtime.ClientRespo } return nil, result + case 401: + result := NewPcloudNetworksPortsPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: result := NewPcloudNetworksPortsPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudNetworksPortsPutBadRequest) readResponse(response runtime.ClientR return nil } +// NewPcloudNetworksPortsPutUnauthorized creates a PcloudNetworksPortsPutUnauthorized with default headers values +func NewPcloudNetworksPortsPutUnauthorized() *PcloudNetworksPortsPutUnauthorized { + return &PcloudNetworksPortsPutUnauthorized{} +} + +/*PcloudNetworksPortsPutUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudNetworksPortsPutUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudNetworksPortsPutUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudNetworksPortsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudNetworksPortsPutUnprocessableEntity creates a PcloudNetworksPortsPutUnprocessableEntity with default headers values func NewPcloudNetworksPortsPutUnprocessableEntity() *PcloudNetworksPortsPutUnprocessableEntity { return &PcloudNetworksPortsPutUnprocessableEntity{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_responses.go index 3179a066029..5fd002002e1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_responses.go @@ -46,6 +46,13 @@ func (o *PcloudNetworksPostReader) ReadResponse(response runtime.ClientResponse, } return nil, result + case 401: + result := NewPcloudNetworksPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudNetworksPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -159,6 +166,35 @@ func (o *PcloudNetworksPostBadRequest) readResponse(response runtime.ClientRespo return nil } +// NewPcloudNetworksPostUnauthorized creates a PcloudNetworksPostUnauthorized with default headers values +func NewPcloudNetworksPostUnauthorized() *PcloudNetworksPostUnauthorized { + return &PcloudNetworksPostUnauthorized{} +} + +/*PcloudNetworksPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudNetworksPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudNetworksPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudNetworksPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudNetworksPostConflict creates a PcloudNetworksPostConflict with default headers values func NewPcloudNetworksPostConflict() *PcloudNetworksPostConflict { return &PcloudNetworksPostConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_responses.go index e4412da0f58..accda0c917f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_responses.go @@ -39,6 +39,13 @@ func (o *PcloudNetworksPutReader) ReadResponse(response runtime.ClientResponse, } return nil, result + case 401: + result := NewPcloudNetworksPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: result := NewPcloudNetworksPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudNetworksPutBadRequest) readResponse(response runtime.ClientRespon return nil } +// NewPcloudNetworksPutUnauthorized creates a PcloudNetworksPutUnauthorized with default headers values +func NewPcloudNetworksPutUnauthorized() *PcloudNetworksPutUnauthorized { + return &PcloudNetworksPutUnauthorized{} +} + +/*PcloudNetworksPutUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudNetworksPutUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudNetworksPutUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudNetworksPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudNetworksPutUnprocessableEntity creates a PcloudNetworksPutUnprocessableEntity with default headers values func NewPcloudNetworksPutUnprocessableEntity() *PcloudNetworksPutUnprocessableEntity { return &PcloudNetworksPutUnprocessableEntity{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloud_p_vm_instances_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloud_p_vm_instances_client.go index 22edc1d3a08..f74b7b12ddf 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloud_p_vm_instances_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloud_p_vm_instances_client.go @@ -321,7 +321,7 @@ func (a *Client) PcloudPvminstancesNetworksGetall(params *PcloudPvminstancesNetw } /* -PcloudPvminstancesNetworksPost performs network addition deletion and listing +PcloudPvminstancesNetworksPost performs network addition */ func (a *Client) PcloudPvminstancesNetworksPost(params *PcloudPvminstancesNetworksPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesNetworksPostCreated, error) { // TODO: Validate the params before sending diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go index 45896fbfb3d..710917529ce 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesActionPostReader) ReadResponse(response runtime.Clien } return nil, result + case 401: + result := NewPcloudPvminstancesActionPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudPvminstancesActionPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +121,35 @@ func (o *PcloudPvminstancesActionPostBadRequest) readResponse(response runtime.C return nil } +// NewPcloudPvminstancesActionPostUnauthorized creates a PcloudPvminstancesActionPostUnauthorized with default headers values +func NewPcloudPvminstancesActionPostUnauthorized() *PcloudPvminstancesActionPostUnauthorized { + return &PcloudPvminstancesActionPostUnauthorized{} +} + +/*PcloudPvminstancesActionPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesActionPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesActionPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesActionPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesActionPostNotFound creates a PcloudPvminstancesActionPostNotFound with default headers values func NewPcloudPvminstancesActionPostNotFound() *PcloudPvminstancesActionPostNotFound { return &PcloudPvminstancesActionPostNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go index 8974e1f5f32..f9af4acdb3a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesCapturePostReader) ReadResponse(response runtime.Clie } return result, nil + case 401: + result := NewPcloudPvminstancesCapturePostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudPvminstancesCapturePostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -105,6 +112,35 @@ func (o *PcloudPvminstancesCapturePostAccepted) readResponse(response runtime.Cl return nil } +// NewPcloudPvminstancesCapturePostUnauthorized creates a PcloudPvminstancesCapturePostUnauthorized with default headers values +func NewPcloudPvminstancesCapturePostUnauthorized() *PcloudPvminstancesCapturePostUnauthorized { + return &PcloudPvminstancesCapturePostUnauthorized{} +} + +/*PcloudPvminstancesCapturePostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesCapturePostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesCapturePostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesCapturePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesCapturePostInternalServerError creates a PcloudPvminstancesCapturePostInternalServerError with default headers values func NewPcloudPvminstancesCapturePostInternalServerError() *PcloudPvminstancesCapturePostInternalServerError { return &PcloudPvminstancesCapturePostInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go index 52773217fef..b1933405da1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesClonePostReader) ReadResponse(response runtime.Client } return nil, result + case 401: + result := NewPcloudPvminstancesClonePostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudPvminstancesClonePostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -123,6 +130,35 @@ func (o *PcloudPvminstancesClonePostBadRequest) readResponse(response runtime.Cl return nil } +// NewPcloudPvminstancesClonePostUnauthorized creates a PcloudPvminstancesClonePostUnauthorized with default headers values +func NewPcloudPvminstancesClonePostUnauthorized() *PcloudPvminstancesClonePostUnauthorized { + return &PcloudPvminstancesClonePostUnauthorized{} +} + +/*PcloudPvminstancesClonePostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesClonePostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesClonePostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesClonePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesClonePostConflict creates a PcloudPvminstancesClonePostConflict with default headers values func NewPcloudPvminstancesClonePostConflict() *PcloudPvminstancesClonePostConflict { return &PcloudPvminstancesClonePostConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go index e5fca8af213..6a3d7c80b05 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go @@ -32,6 +32,13 @@ func (o *PcloudPvminstancesConsolePostReader) ReadResponse(response runtime.Clie } return result, nil + case 401: + result := NewPcloudPvminstancesConsolePostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: result := NewPcloudPvminstancesConsolePostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -80,6 +87,35 @@ func (o *PcloudPvminstancesConsolePostCreated) readResponse(response runtime.Cli return nil } +// NewPcloudPvminstancesConsolePostUnauthorized creates a PcloudPvminstancesConsolePostUnauthorized with default headers values +func NewPcloudPvminstancesConsolePostUnauthorized() *PcloudPvminstancesConsolePostUnauthorized { + return &PcloudPvminstancesConsolePostUnauthorized{} +} + +/*PcloudPvminstancesConsolePostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesConsolePostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesConsolePostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesConsolePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesConsolePostUnprocessableEntity creates a PcloudPvminstancesConsolePostUnprocessableEntity with default headers values func NewPcloudPvminstancesConsolePostUnprocessableEntity() *PcloudPvminstancesConsolePostUnprocessableEntity { return &PcloudPvminstancesConsolePostUnprocessableEntity{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go index fa64c53c133..65007fe27e0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesDeleteReader) ReadResponse(response runtime.ClientRes } return nil, result + case 401: + result := NewPcloudPvminstancesDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudPvminstancesDeleteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -121,6 +128,35 @@ func (o *PcloudPvminstancesDeleteBadRequest) readResponse(response runtime.Clien return nil } +// NewPcloudPvminstancesDeleteUnauthorized creates a PcloudPvminstancesDeleteUnauthorized with default headers values +func NewPcloudPvminstancesDeleteUnauthorized() *PcloudPvminstancesDeleteUnauthorized { + return &PcloudPvminstancesDeleteUnauthorized{} +} + +/*PcloudPvminstancesDeleteUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesDeleteUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesDeleteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesDeleteNotFound creates a PcloudPvminstancesDeleteNotFound with default headers values func NewPcloudPvminstancesDeleteNotFound() *PcloudPvminstancesDeleteNotFound { return &PcloudPvminstancesDeleteNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go index 4b7d77d8684..1ab6096bfca 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesGetReader) ReadResponse(response runtime.ClientRespon } return nil, result + case 401: + result := NewPcloudPvminstancesGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudPvminstancesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudPvminstancesGetBadRequest) readResponse(response runtime.ClientRe return nil } +// NewPcloudPvminstancesGetUnauthorized creates a PcloudPvminstancesGetUnauthorized with default headers values +func NewPcloudPvminstancesGetUnauthorized() *PcloudPvminstancesGetUnauthorized { + return &PcloudPvminstancesGetUnauthorized{} +} + +/*PcloudPvminstancesGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesGetNotFound creates a PcloudPvminstancesGetNotFound with default headers values func NewPcloudPvminstancesGetNotFound() *PcloudPvminstancesGetNotFound { return &PcloudPvminstancesGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go index 334d18daf3f..03179620a9b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesGetallReader) ReadResponse(response runtime.ClientRes } return nil, result + case 401: + result := NewPcloudPvminstancesGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudPvminstancesGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -109,6 +116,35 @@ func (o *PcloudPvminstancesGetallBadRequest) readResponse(response runtime.Clien return nil } +// NewPcloudPvminstancesGetallUnauthorized creates a PcloudPvminstancesGetallUnauthorized with default headers values +func NewPcloudPvminstancesGetallUnauthorized() *PcloudPvminstancesGetallUnauthorized { + return &PcloudPvminstancesGetallUnauthorized{} +} + +/*PcloudPvminstancesGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesGetallInternalServerError creates a PcloudPvminstancesGetallInternalServerError with default headers values func NewPcloudPvminstancesGetallInternalServerError() *PcloudPvminstancesGetallInternalServerError { return &PcloudPvminstancesGetallInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go index 06916c3b8ce..750efaf056c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesNetworksDeleteReader) ReadResponse(response runtime.C } return nil, result + case 401: + result := NewPcloudPvminstancesNetworksDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: result := NewPcloudPvminstancesNetworksDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +121,35 @@ func (o *PcloudPvminstancesNetworksDeleteBadRequest) readResponse(response runti return nil } +// NewPcloudPvminstancesNetworksDeleteUnauthorized creates a PcloudPvminstancesNetworksDeleteUnauthorized with default headers values +func NewPcloudPvminstancesNetworksDeleteUnauthorized() *PcloudPvminstancesNetworksDeleteUnauthorized { + return &PcloudPvminstancesNetworksDeleteUnauthorized{} +} + +/*PcloudPvminstancesNetworksDeleteUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesNetworksDeleteUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesNetworksDeleteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesNetworksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesNetworksDeleteGone creates a PcloudPvminstancesNetworksDeleteGone with default headers values func NewPcloudPvminstancesNetworksDeleteGone() *PcloudPvminstancesNetworksDeleteGone { return &PcloudPvminstancesNetworksDeleteGone{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go index c5f0e555f09..3e29b24587e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go @@ -32,6 +32,13 @@ func (o *PcloudPvminstancesNetworksGetReader) ReadResponse(response runtime.Clie } return result, nil + case 401: + result := NewPcloudPvminstancesNetworksGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudPvminstancesNetworksGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -80,6 +87,35 @@ func (o *PcloudPvminstancesNetworksGetOK) readResponse(response runtime.ClientRe return nil } +// NewPcloudPvminstancesNetworksGetUnauthorized creates a PcloudPvminstancesNetworksGetUnauthorized with default headers values +func NewPcloudPvminstancesNetworksGetUnauthorized() *PcloudPvminstancesNetworksGetUnauthorized { + return &PcloudPvminstancesNetworksGetUnauthorized{} +} + +/*PcloudPvminstancesNetworksGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesNetworksGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesNetworksGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesNetworksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesNetworksGetNotFound creates a PcloudPvminstancesNetworksGetNotFound with default headers values func NewPcloudPvminstancesNetworksGetNotFound() *PcloudPvminstancesNetworksGetNotFound { return &PcloudPvminstancesNetworksGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go index df7783e3046..7025b1e5d0c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesNetworksGetallReader) ReadResponse(response runtime.C } return nil, result + case 401: + result := NewPcloudPvminstancesNetworksGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudPvminstancesNetworksGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -109,6 +116,35 @@ func (o *PcloudPvminstancesNetworksGetallBadRequest) readResponse(response runti return nil } +// NewPcloudPvminstancesNetworksGetallUnauthorized creates a PcloudPvminstancesNetworksGetallUnauthorized with default headers values +func NewPcloudPvminstancesNetworksGetallUnauthorized() *PcloudPvminstancesNetworksGetallUnauthorized { + return &PcloudPvminstancesNetworksGetallUnauthorized{} +} + +/*PcloudPvminstancesNetworksGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesNetworksGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesNetworksGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesNetworksGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesNetworksGetallInternalServerError creates a PcloudPvminstancesNetworksGetallInternalServerError with default headers values func NewPcloudPvminstancesNetworksGetallInternalServerError() *PcloudPvminstancesNetworksGetallInternalServerError { return &PcloudPvminstancesNetworksGetallInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go index afc778fd122..17acedd26eb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesNetworksPostReader) ReadResponse(response runtime.Cli } return nil, result + case 401: + result := NewPcloudPvminstancesNetworksPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudPvminstancesNetworksPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -123,6 +130,35 @@ func (o *PcloudPvminstancesNetworksPostBadRequest) readResponse(response runtime return nil } +// NewPcloudPvminstancesNetworksPostUnauthorized creates a PcloudPvminstancesNetworksPostUnauthorized with default headers values +func NewPcloudPvminstancesNetworksPostUnauthorized() *PcloudPvminstancesNetworksPostUnauthorized { + return &PcloudPvminstancesNetworksPostUnauthorized{} +} + +/*PcloudPvminstancesNetworksPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesNetworksPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesNetworksPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesNetworksPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesNetworksPostConflict creates a PcloudPvminstancesNetworksPostConflict with default headers values func NewPcloudPvminstancesNetworksPostConflict() *PcloudPvminstancesNetworksPostConflict { return &PcloudPvminstancesNetworksPostConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go index dfa55ca6b69..5d7e0269aca 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesOperationsPostReader) ReadResponse(response runtime.C } return nil, result + case 401: + result := NewPcloudPvminstancesOperationsPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudPvminstancesOperationsPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -121,6 +128,35 @@ func (o *PcloudPvminstancesOperationsPostBadRequest) readResponse(response runti return nil } +// NewPcloudPvminstancesOperationsPostUnauthorized creates a PcloudPvminstancesOperationsPostUnauthorized with default headers values +func NewPcloudPvminstancesOperationsPostUnauthorized() *PcloudPvminstancesOperationsPostUnauthorized { + return &PcloudPvminstancesOperationsPostUnauthorized{} +} + +/*PcloudPvminstancesOperationsPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesOperationsPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesOperationsPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesOperationsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesOperationsPostNotFound creates a PcloudPvminstancesOperationsPostNotFound with default headers values func NewPcloudPvminstancesOperationsPostNotFound() *PcloudPvminstancesOperationsPostNotFound { return &PcloudPvminstancesOperationsPostNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_parameters.go index 3501f48eb05..a615987699e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_parameters.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_parameters.go @@ -65,7 +65,7 @@ for the pcloud pvminstances post operation typically these are written to a http type PcloudPvminstancesPostParams struct { /*Body - Parameters for the creation of a new tenant + Parameters for the creation of a new Power VM Instance */ Body *models.PVMInstanceCreate diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go index aba6a62e65a..4182e17f6ba 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go @@ -53,6 +53,13 @@ func (o *PcloudPvminstancesPostReader) ReadResponse(response runtime.ClientRespo } return nil, result + case 401: + result := NewPcloudPvminstancesPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudPvminstancesPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -189,6 +196,35 @@ func (o *PcloudPvminstancesPostBadRequest) readResponse(response runtime.ClientR return nil } +// NewPcloudPvminstancesPostUnauthorized creates a PcloudPvminstancesPostUnauthorized with default headers values +func NewPcloudPvminstancesPostUnauthorized() *PcloudPvminstancesPostUnauthorized { + return &PcloudPvminstancesPostUnauthorized{} +} + +/*PcloudPvminstancesPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesPostConflict creates a PcloudPvminstancesPostConflict with default headers values func NewPcloudPvminstancesPostConflict() *PcloudPvminstancesPostConflict { return &PcloudPvminstancesPostConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go index 31aefdf0e6d..52186195eb6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesPutReader) ReadResponse(response runtime.ClientRespon } return nil, result + case 401: + result := NewPcloudPvminstancesPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: result := NewPcloudPvminstancesPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudPvminstancesPutBadRequest) readResponse(response runtime.ClientRe return nil } +// NewPcloudPvminstancesPutUnauthorized creates a PcloudPvminstancesPutUnauthorized with default headers values +func NewPcloudPvminstancesPutUnauthorized() *PcloudPvminstancesPutUnauthorized { + return &PcloudPvminstancesPutUnauthorized{} +} + +/*PcloudPvminstancesPutUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesPutUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesPutUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesPutUnprocessableEntity creates a PcloudPvminstancesPutUnprocessableEntity with default headers values func NewPcloudPvminstancesPutUnprocessableEntity() *PcloudPvminstancesPutUnprocessableEntity { return &PcloudPvminstancesPutUnprocessableEntity{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go index 5b3a92355a0..88251dff754 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go @@ -39,6 +39,20 @@ func (o *PcloudPvminstancesSnapshotsGetallReader) ReadResponse(response runtime. } return nil, result + case 401: + result := NewPcloudPvminstancesSnapshotsGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 404: + result := NewPcloudPvminstancesSnapshotsGetallNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudPvminstancesSnapshotsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -109,6 +123,64 @@ func (o *PcloudPvminstancesSnapshotsGetallBadRequest) readResponse(response runt return nil } +// NewPcloudPvminstancesSnapshotsGetallUnauthorized creates a PcloudPvminstancesSnapshotsGetallUnauthorized with default headers values +func NewPcloudPvminstancesSnapshotsGetallUnauthorized() *PcloudPvminstancesSnapshotsGetallUnauthorized { + return &PcloudPvminstancesSnapshotsGetallUnauthorized{} +} + +/*PcloudPvminstancesSnapshotsGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesSnapshotsGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPvminstancesSnapshotsGetallNotFound creates a PcloudPvminstancesSnapshotsGetallNotFound with default headers values +func NewPcloudPvminstancesSnapshotsGetallNotFound() *PcloudPvminstancesSnapshotsGetallNotFound { + return &PcloudPvminstancesSnapshotsGetallNotFound{} +} + +/*PcloudPvminstancesSnapshotsGetallNotFound handles this case with default header values. + +Not Found +*/ +type PcloudPvminstancesSnapshotsGetallNotFound struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesSnapshotsGetallNotFound) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallNotFound %+v", 404, o.Payload) +} + +func (o *PcloudPvminstancesSnapshotsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesSnapshotsGetallInternalServerError creates a PcloudPvminstancesSnapshotsGetallInternalServerError with default headers values func NewPcloudPvminstancesSnapshotsGetallInternalServerError() *PcloudPvminstancesSnapshotsGetallInternalServerError { return &PcloudPvminstancesSnapshotsGetallInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go index 3adea85a34b..13f84a959a5 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go @@ -39,6 +39,20 @@ func (o *PcloudPvminstancesSnapshotsPostReader) ReadResponse(response runtime.Cl } return nil, result + case 401: + result := NewPcloudPvminstancesSnapshotsPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 404: + result := NewPcloudPvminstancesSnapshotsPostNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudPvminstancesSnapshotsPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +130,64 @@ func (o *PcloudPvminstancesSnapshotsPostBadRequest) readResponse(response runtim return nil } +// NewPcloudPvminstancesSnapshotsPostUnauthorized creates a PcloudPvminstancesSnapshotsPostUnauthorized with default headers values +func NewPcloudPvminstancesSnapshotsPostUnauthorized() *PcloudPvminstancesSnapshotsPostUnauthorized { + return &PcloudPvminstancesSnapshotsPostUnauthorized{} +} + +/*PcloudPvminstancesSnapshotsPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesSnapshotsPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesSnapshotsPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesSnapshotsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPvminstancesSnapshotsPostNotFound creates a PcloudPvminstancesSnapshotsPostNotFound with default headers values +func NewPcloudPvminstancesSnapshotsPostNotFound() *PcloudPvminstancesSnapshotsPostNotFound { + return &PcloudPvminstancesSnapshotsPostNotFound{} +} + +/*PcloudPvminstancesSnapshotsPostNotFound handles this case with default header values. + +Not Found +*/ +type PcloudPvminstancesSnapshotsPostNotFound struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesSnapshotsPostNotFound) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostNotFound %+v", 404, o.Payload) +} + +func (o *PcloudPvminstancesSnapshotsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesSnapshotsPostConflict creates a PcloudPvminstancesSnapshotsPostConflict with default headers values func NewPcloudPvminstancesSnapshotsPostConflict() *PcloudPvminstancesSnapshotsPostConflict { return &PcloudPvminstancesSnapshotsPostConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go index 91029793160..bc3d4601420 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesSnapshotsRestorePostReader) ReadResponse(response run } return nil, result + case 401: + result := NewPcloudPvminstancesSnapshotsRestorePostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudPvminstancesSnapshotsRestorePostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) readResponse(response return nil } +// NewPcloudPvminstancesSnapshotsRestorePostUnauthorized creates a PcloudPvminstancesSnapshotsRestorePostUnauthorized with default headers values +func NewPcloudPvminstancesSnapshotsRestorePostUnauthorized() *PcloudPvminstancesSnapshotsRestorePostUnauthorized { + return &PcloudPvminstancesSnapshotsRestorePostUnauthorized{} +} + +/*PcloudPvminstancesSnapshotsRestorePostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesSnapshotsRestorePostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesSnapshotsRestorePostConflict creates a PcloudPvminstancesSnapshotsRestorePostConflict with default headers values func NewPcloudPvminstancesSnapshotsRestorePostConflict() *PcloudPvminstancesSnapshotsRestorePostConflict { return &PcloudPvminstancesSnapshotsRestorePostConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go new file mode 100644 index 00000000000..9f71199f0d4 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_placement_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new p cloud placement groups API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for p cloud placement groups API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +PcloudPlacementgroupsDelete deletes server placement group +*/ +func (a *Client) PcloudPlacementgroupsDelete(params *PcloudPlacementgroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPlacementgroupsDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPlacementgroupsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "pcloud.placementgroups.delete", + Method: "DELETE", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPlacementgroupsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PcloudPlacementgroupsDeleteOK), nil + +} + +/* +PcloudPlacementgroupsGet gets server placement group detail +*/ +func (a *Client) PcloudPlacementgroupsGet(params *PcloudPlacementgroupsGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPlacementgroupsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPlacementgroupsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "pcloud.placementgroups.get", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPlacementgroupsGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PcloudPlacementgroupsGetOK), nil + +} + +/* +PcloudPlacementgroupsGetall gets all server placement groups +*/ +func (a *Client) PcloudPlacementgroupsGetall(params *PcloudPlacementgroupsGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPlacementgroupsGetallOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPlacementgroupsGetallParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "pcloud.placementgroups.getall", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPlacementgroupsGetallReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PcloudPlacementgroupsGetallOK), nil + +} + +/* +PcloudPlacementgroupsMembersDelete removes server from placement group +*/ +func (a *Client) PcloudPlacementgroupsMembersDelete(params *PcloudPlacementgroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPlacementgroupsMembersDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPlacementgroupsMembersDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "pcloud.placementgroups.members.delete", + Method: "DELETE", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPlacementgroupsMembersDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PcloudPlacementgroupsMembersDeleteOK), nil + +} + +/* +PcloudPlacementgroupsMembersPost adds server to placement group +*/ +func (a *Client) PcloudPlacementgroupsMembersPost(params *PcloudPlacementgroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPlacementgroupsMembersPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPlacementgroupsMembersPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "pcloud.placementgroups.members.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPlacementgroupsMembersPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PcloudPlacementgroupsMembersPostOK), nil + +} + +/* +PcloudPlacementgroupsPost creates a new server placement group +*/ +func (a *Client) PcloudPlacementgroupsPost(params *PcloudPlacementgroupsPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPlacementgroupsPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPlacementgroupsPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "pcloud.placementgroups.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPlacementgroupsPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PcloudPlacementgroupsPostOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_parameters.go new file mode 100644 index 00000000000..e89a5ab0c3a --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_placement_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewPcloudPlacementgroupsDeleteParams creates a new PcloudPlacementgroupsDeleteParams object +// with the default values initialized. +func NewPcloudPlacementgroupsDeleteParams() *PcloudPlacementgroupsDeleteParams { + var () + return &PcloudPlacementgroupsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudPlacementgroupsDeleteParamsWithTimeout creates a new PcloudPlacementgroupsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPcloudPlacementgroupsDeleteParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsDeleteParams { + var () + return &PcloudPlacementgroupsDeleteParams{ + + timeout: timeout, + } +} + +// NewPcloudPlacementgroupsDeleteParamsWithContext creates a new PcloudPlacementgroupsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewPcloudPlacementgroupsDeleteParamsWithContext(ctx context.Context) *PcloudPlacementgroupsDeleteParams { + var () + return &PcloudPlacementgroupsDeleteParams{ + + Context: ctx, + } +} + +// NewPcloudPlacementgroupsDeleteParamsWithHTTPClient creates a new PcloudPlacementgroupsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPcloudPlacementgroupsDeleteParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsDeleteParams { + var () + return &PcloudPlacementgroupsDeleteParams{ + HTTPClient: client, + } +} + +/*PcloudPlacementgroupsDeleteParams contains all the parameters to send to the API endpoint +for the pcloud placementgroups delete operation typically these are written to a http.Request +*/ +type PcloudPlacementgroupsDeleteParams struct { + + /*CloudInstanceID + Cloud Instance ID of a PCloud Instance + + */ + CloudInstanceID string + /*PlacementGroupID + Placement Group ID + + */ + PlacementGroupID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the pcloud placementgroups delete params +func (o *PcloudPlacementgroupsDeleteParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud placementgroups delete params +func (o *PcloudPlacementgroupsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud placementgroups delete params +func (o *PcloudPlacementgroupsDeleteParams) WithContext(ctx context.Context) *PcloudPlacementgroupsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud placementgroups delete params +func (o *PcloudPlacementgroupsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud placementgroups delete params +func (o *PcloudPlacementgroupsDeleteParams) WithHTTPClient(client *http.Client) *PcloudPlacementgroupsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud placementgroups delete params +func (o *PcloudPlacementgroupsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud placementgroups delete params +func (o *PcloudPlacementgroupsDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPlacementgroupsDeleteParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud placementgroups delete params +func (o *PcloudPlacementgroupsDeleteParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WithPlacementGroupID adds the placementGroupID to the pcloud placementgroups delete params +func (o *PcloudPlacementgroupsDeleteParams) WithPlacementGroupID(placementGroupID string) *PcloudPlacementgroupsDeleteParams { + o.SetPlacementGroupID(placementGroupID) + return o +} + +// SetPlacementGroupID adds the placementGroupId to the pcloud placementgroups delete params +func (o *PcloudPlacementgroupsDeleteParams) SetPlacementGroupID(placementGroupID string) { + o.PlacementGroupID = placementGroupID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudPlacementgroupsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + // path param placement_group_id + if err := r.SetPathParam("placement_group_id", o.PlacementGroupID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go new file mode 100644 index 00000000000..fac91ef8589 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_placement_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudPlacementgroupsDeleteReader is a Reader for the PcloudPlacementgroupsDelete structure. +type PcloudPlacementgroupsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudPlacementgroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewPcloudPlacementgroupsDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPcloudPlacementgroupsDeleteBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 404: + result := NewPcloudPlacementgroupsDeleteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 500: + result := NewPcloudPlacementgroupsDeleteInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPcloudPlacementgroupsDeleteOK creates a PcloudPlacementgroupsDeleteOK with default headers values +func NewPcloudPlacementgroupsDeleteOK() *PcloudPlacementgroupsDeleteOK { + return &PcloudPlacementgroupsDeleteOK{} +} + +/*PcloudPlacementgroupsDeleteOK handles this case with default header values. + +OK +*/ +type PcloudPlacementgroupsDeleteOK struct { + Payload models.Object +} + +func (o *PcloudPlacementgroupsDeleteOK) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteOK %+v", 200, o.Payload) +} + +func (o *PcloudPlacementgroupsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsDeleteBadRequest creates a PcloudPlacementgroupsDeleteBadRequest with default headers values +func NewPcloudPlacementgroupsDeleteBadRequest() *PcloudPlacementgroupsDeleteBadRequest { + return &PcloudPlacementgroupsDeleteBadRequest{} +} + +/*PcloudPlacementgroupsDeleteBadRequest handles this case with default header values. + +Bad Request +*/ +type PcloudPlacementgroupsDeleteBadRequest struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsDeleteBadRequest) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteBadRequest %+v", 400, o.Payload) +} + +func (o *PcloudPlacementgroupsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsDeleteNotFound creates a PcloudPlacementgroupsDeleteNotFound with default headers values +func NewPcloudPlacementgroupsDeleteNotFound() *PcloudPlacementgroupsDeleteNotFound { + return &PcloudPlacementgroupsDeleteNotFound{} +} + +/*PcloudPlacementgroupsDeleteNotFound handles this case with default header values. + +Not Found +*/ +type PcloudPlacementgroupsDeleteNotFound struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsDeleteNotFound) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteNotFound %+v", 404, o.Payload) +} + +func (o *PcloudPlacementgroupsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsDeleteInternalServerError creates a PcloudPlacementgroupsDeleteInternalServerError with default headers values +func NewPcloudPlacementgroupsDeleteInternalServerError() *PcloudPlacementgroupsDeleteInternalServerError { + return &PcloudPlacementgroupsDeleteInternalServerError{} +} + +/*PcloudPlacementgroupsDeleteInternalServerError handles this case with default header values. + +Internal Server Error +*/ +type PcloudPlacementgroupsDeleteInternalServerError struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsDeleteInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteInternalServerError %+v", 500, o.Payload) +} + +func (o *PcloudPlacementgroupsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_parameters.go new file mode 100644 index 00000000000..d03aeb446d4 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_placement_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewPcloudPlacementgroupsGetParams creates a new PcloudPlacementgroupsGetParams object +// with the default values initialized. +func NewPcloudPlacementgroupsGetParams() *PcloudPlacementgroupsGetParams { + var () + return &PcloudPlacementgroupsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudPlacementgroupsGetParamsWithTimeout creates a new PcloudPlacementgroupsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPcloudPlacementgroupsGetParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsGetParams { + var () + return &PcloudPlacementgroupsGetParams{ + + timeout: timeout, + } +} + +// NewPcloudPlacementgroupsGetParamsWithContext creates a new PcloudPlacementgroupsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewPcloudPlacementgroupsGetParamsWithContext(ctx context.Context) *PcloudPlacementgroupsGetParams { + var () + return &PcloudPlacementgroupsGetParams{ + + Context: ctx, + } +} + +// NewPcloudPlacementgroupsGetParamsWithHTTPClient creates a new PcloudPlacementgroupsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPcloudPlacementgroupsGetParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsGetParams { + var () + return &PcloudPlacementgroupsGetParams{ + HTTPClient: client, + } +} + +/*PcloudPlacementgroupsGetParams contains all the parameters to send to the API endpoint +for the pcloud placementgroups get operation typically these are written to a http.Request +*/ +type PcloudPlacementgroupsGetParams struct { + + /*CloudInstanceID + Cloud Instance ID of a PCloud Instance + + */ + CloudInstanceID string + /*PlacementGroupID + Placement Group ID + + */ + PlacementGroupID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the pcloud placementgroups get params +func (o *PcloudPlacementgroupsGetParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud placementgroups get params +func (o *PcloudPlacementgroupsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud placementgroups get params +func (o *PcloudPlacementgroupsGetParams) WithContext(ctx context.Context) *PcloudPlacementgroupsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud placementgroups get params +func (o *PcloudPlacementgroupsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud placementgroups get params +func (o *PcloudPlacementgroupsGetParams) WithHTTPClient(client *http.Client) *PcloudPlacementgroupsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud placementgroups get params +func (o *PcloudPlacementgroupsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud placementgroups get params +func (o *PcloudPlacementgroupsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPlacementgroupsGetParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud placementgroups get params +func (o *PcloudPlacementgroupsGetParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WithPlacementGroupID adds the placementGroupID to the pcloud placementgroups get params +func (o *PcloudPlacementgroupsGetParams) WithPlacementGroupID(placementGroupID string) *PcloudPlacementgroupsGetParams { + o.SetPlacementGroupID(placementGroupID) + return o +} + +// SetPlacementGroupID adds the placementGroupId to the pcloud placementgroups get params +func (o *PcloudPlacementgroupsGetParams) SetPlacementGroupID(placementGroupID string) { + o.PlacementGroupID = placementGroupID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudPlacementgroupsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + // path param placement_group_id + if err := r.SetPathParam("placement_group_id", o.PlacementGroupID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go new file mode 100644 index 00000000000..e3b74d28f75 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_placement_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudPlacementgroupsGetReader is a Reader for the PcloudPlacementgroupsGet structure. +type PcloudPlacementgroupsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudPlacementgroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewPcloudPlacementgroupsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPcloudPlacementgroupsGetBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 500: + result := NewPcloudPlacementgroupsGetInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPcloudPlacementgroupsGetOK creates a PcloudPlacementgroupsGetOK with default headers values +func NewPcloudPlacementgroupsGetOK() *PcloudPlacementgroupsGetOK { + return &PcloudPlacementgroupsGetOK{} +} + +/*PcloudPlacementgroupsGetOK handles this case with default header values. + +OK +*/ +type PcloudPlacementgroupsGetOK struct { + Payload *models.PlacementGroup +} + +func (o *PcloudPlacementgroupsGetOK) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetOK %+v", 200, o.Payload) +} + +func (o *PcloudPlacementgroupsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PlacementGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsGetBadRequest creates a PcloudPlacementgroupsGetBadRequest with default headers values +func NewPcloudPlacementgroupsGetBadRequest() *PcloudPlacementgroupsGetBadRequest { + return &PcloudPlacementgroupsGetBadRequest{} +} + +/*PcloudPlacementgroupsGetBadRequest handles this case with default header values. + +Bad Request +*/ +type PcloudPlacementgroupsGetBadRequest struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsGetBadRequest) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetBadRequest %+v", 400, o.Payload) +} + +func (o *PcloudPlacementgroupsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsGetInternalServerError creates a PcloudPlacementgroupsGetInternalServerError with default headers values +func NewPcloudPlacementgroupsGetInternalServerError() *PcloudPlacementgroupsGetInternalServerError { + return &PcloudPlacementgroupsGetInternalServerError{} +} + +/*PcloudPlacementgroupsGetInternalServerError handles this case with default header values. + +Internal Server Error +*/ +type PcloudPlacementgroupsGetInternalServerError struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsGetInternalServerError) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetInternalServerError %+v", 500, o.Payload) +} + +func (o *PcloudPlacementgroupsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_parameters.go new file mode 100644 index 00000000000..01279c2d2f3 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_placement_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewPcloudPlacementgroupsGetallParams creates a new PcloudPlacementgroupsGetallParams object +// with the default values initialized. +func NewPcloudPlacementgroupsGetallParams() *PcloudPlacementgroupsGetallParams { + var () + return &PcloudPlacementgroupsGetallParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudPlacementgroupsGetallParamsWithTimeout creates a new PcloudPlacementgroupsGetallParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPcloudPlacementgroupsGetallParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsGetallParams { + var () + return &PcloudPlacementgroupsGetallParams{ + + timeout: timeout, + } +} + +// NewPcloudPlacementgroupsGetallParamsWithContext creates a new PcloudPlacementgroupsGetallParams object +// with the default values initialized, and the ability to set a context for a request +func NewPcloudPlacementgroupsGetallParamsWithContext(ctx context.Context) *PcloudPlacementgroupsGetallParams { + var () + return &PcloudPlacementgroupsGetallParams{ + + Context: ctx, + } +} + +// NewPcloudPlacementgroupsGetallParamsWithHTTPClient creates a new PcloudPlacementgroupsGetallParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPcloudPlacementgroupsGetallParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsGetallParams { + var () + return &PcloudPlacementgroupsGetallParams{ + HTTPClient: client, + } +} + +/*PcloudPlacementgroupsGetallParams contains all the parameters to send to the API endpoint +for the pcloud placementgroups getall operation typically these are written to a http.Request +*/ +type PcloudPlacementgroupsGetallParams struct { + + /*CloudInstanceID + Cloud Instance ID of a PCloud Instance + + */ + CloudInstanceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the pcloud placementgroups getall params +func (o *PcloudPlacementgroupsGetallParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsGetallParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud placementgroups getall params +func (o *PcloudPlacementgroupsGetallParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud placementgroups getall params +func (o *PcloudPlacementgroupsGetallParams) WithContext(ctx context.Context) *PcloudPlacementgroupsGetallParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud placementgroups getall params +func (o *PcloudPlacementgroupsGetallParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud placementgroups getall params +func (o *PcloudPlacementgroupsGetallParams) WithHTTPClient(client *http.Client) *PcloudPlacementgroupsGetallParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud placementgroups getall params +func (o *PcloudPlacementgroupsGetallParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud placementgroups getall params +func (o *PcloudPlacementgroupsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPlacementgroupsGetallParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud placementgroups getall params +func (o *PcloudPlacementgroupsGetallParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudPlacementgroupsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go new file mode 100644 index 00000000000..f792a5244d9 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_placement_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudPlacementgroupsGetallReader is a Reader for the PcloudPlacementgroupsGetall structure. +type PcloudPlacementgroupsGetallReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudPlacementgroupsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewPcloudPlacementgroupsGetallOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPcloudPlacementgroupsGetallBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 401: + result := NewPcloudPlacementgroupsGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 500: + result := NewPcloudPlacementgroupsGetallInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPcloudPlacementgroupsGetallOK creates a PcloudPlacementgroupsGetallOK with default headers values +func NewPcloudPlacementgroupsGetallOK() *PcloudPlacementgroupsGetallOK { + return &PcloudPlacementgroupsGetallOK{} +} + +/*PcloudPlacementgroupsGetallOK handles this case with default header values. + +OK +*/ +type PcloudPlacementgroupsGetallOK struct { + Payload *models.PlacementGroups +} + +func (o *PcloudPlacementgroupsGetallOK) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallOK %+v", 200, o.Payload) +} + +func (o *PcloudPlacementgroupsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PlacementGroups) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsGetallBadRequest creates a PcloudPlacementgroupsGetallBadRequest with default headers values +func NewPcloudPlacementgroupsGetallBadRequest() *PcloudPlacementgroupsGetallBadRequest { + return &PcloudPlacementgroupsGetallBadRequest{} +} + +/*PcloudPlacementgroupsGetallBadRequest handles this case with default header values. + +Bad Request +*/ +type PcloudPlacementgroupsGetallBadRequest struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsGetallBadRequest) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallBadRequest %+v", 400, o.Payload) +} + +func (o *PcloudPlacementgroupsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsGetallUnauthorized creates a PcloudPlacementgroupsGetallUnauthorized with default headers values +func NewPcloudPlacementgroupsGetallUnauthorized() *PcloudPlacementgroupsGetallUnauthorized { + return &PcloudPlacementgroupsGetallUnauthorized{} +} + +/*PcloudPlacementgroupsGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPlacementgroupsGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPlacementgroupsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsGetallInternalServerError creates a PcloudPlacementgroupsGetallInternalServerError with default headers values +func NewPcloudPlacementgroupsGetallInternalServerError() *PcloudPlacementgroupsGetallInternalServerError { + return &PcloudPlacementgroupsGetallInternalServerError{} +} + +/*PcloudPlacementgroupsGetallInternalServerError handles this case with default header values. + +Internal Server Error +*/ +type PcloudPlacementgroupsGetallInternalServerError struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsGetallInternalServerError) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallInternalServerError %+v", 500, o.Payload) +} + +func (o *PcloudPlacementgroupsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_parameters.go new file mode 100644 index 00000000000..f9422bd761d --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_parameters.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_placement_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewPcloudPlacementgroupsMembersDeleteParams creates a new PcloudPlacementgroupsMembersDeleteParams object +// with the default values initialized. +func NewPcloudPlacementgroupsMembersDeleteParams() *PcloudPlacementgroupsMembersDeleteParams { + var () + return &PcloudPlacementgroupsMembersDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudPlacementgroupsMembersDeleteParamsWithTimeout creates a new PcloudPlacementgroupsMembersDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPcloudPlacementgroupsMembersDeleteParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsMembersDeleteParams { + var () + return &PcloudPlacementgroupsMembersDeleteParams{ + + timeout: timeout, + } +} + +// NewPcloudPlacementgroupsMembersDeleteParamsWithContext creates a new PcloudPlacementgroupsMembersDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewPcloudPlacementgroupsMembersDeleteParamsWithContext(ctx context.Context) *PcloudPlacementgroupsMembersDeleteParams { + var () + return &PcloudPlacementgroupsMembersDeleteParams{ + + Context: ctx, + } +} + +// NewPcloudPlacementgroupsMembersDeleteParamsWithHTTPClient creates a new PcloudPlacementgroupsMembersDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPcloudPlacementgroupsMembersDeleteParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsMembersDeleteParams { + var () + return &PcloudPlacementgroupsMembersDeleteParams{ + HTTPClient: client, + } +} + +/*PcloudPlacementgroupsMembersDeleteParams contains all the parameters to send to the API endpoint +for the pcloud placementgroups members delete operation typically these are written to a http.Request +*/ +type PcloudPlacementgroupsMembersDeleteParams struct { + + /*Body + Parameters for removing a Server in a Placement Group + + */ + Body *models.PlacementGroupServer + /*CloudInstanceID + Cloud Instance ID of a PCloud Instance + + */ + CloudInstanceID string + /*PlacementGroupID + Placement Group ID + + */ + PlacementGroupID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the pcloud placementgroups members delete params +func (o *PcloudPlacementgroupsMembersDeleteParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsMembersDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud placementgroups members delete params +func (o *PcloudPlacementgroupsMembersDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud placementgroups members delete params +func (o *PcloudPlacementgroupsMembersDeleteParams) WithContext(ctx context.Context) *PcloudPlacementgroupsMembersDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud placementgroups members delete params +func (o *PcloudPlacementgroupsMembersDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud placementgroups members delete params +func (o *PcloudPlacementgroupsMembersDeleteParams) WithHTTPClient(client *http.Client) *PcloudPlacementgroupsMembersDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud placementgroups members delete params +func (o *PcloudPlacementgroupsMembersDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the pcloud placementgroups members delete params +func (o *PcloudPlacementgroupsMembersDeleteParams) WithBody(body *models.PlacementGroupServer) *PcloudPlacementgroupsMembersDeleteParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the pcloud placementgroups members delete params +func (o *PcloudPlacementgroupsMembersDeleteParams) SetBody(body *models.PlacementGroupServer) { + o.Body = body +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud placementgroups members delete params +func (o *PcloudPlacementgroupsMembersDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPlacementgroupsMembersDeleteParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud placementgroups members delete params +func (o *PcloudPlacementgroupsMembersDeleteParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WithPlacementGroupID adds the placementGroupID to the pcloud placementgroups members delete params +func (o *PcloudPlacementgroupsMembersDeleteParams) WithPlacementGroupID(placementGroupID string) *PcloudPlacementgroupsMembersDeleteParams { + o.SetPlacementGroupID(placementGroupID) + return o +} + +// SetPlacementGroupID adds the placementGroupId to the pcloud placementgroups members delete params +func (o *PcloudPlacementgroupsMembersDeleteParams) SetPlacementGroupID(placementGroupID string) { + o.PlacementGroupID = placementGroupID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudPlacementgroupsMembersDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + // path param placement_group_id + if err := r.SetPathParam("placement_group_id", o.PlacementGroupID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go new file mode 100644 index 00000000000..8c3dde34a72 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_placement_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudPlacementgroupsMembersDeleteReader is a Reader for the PcloudPlacementgroupsMembersDelete structure. +type PcloudPlacementgroupsMembersDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudPlacementgroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewPcloudPlacementgroupsMembersDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPcloudPlacementgroupsMembersDeleteBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 409: + result := NewPcloudPlacementgroupsMembersDeleteConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 422: + result := NewPcloudPlacementgroupsMembersDeleteUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 500: + result := NewPcloudPlacementgroupsMembersDeleteInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPcloudPlacementgroupsMembersDeleteOK creates a PcloudPlacementgroupsMembersDeleteOK with default headers values +func NewPcloudPlacementgroupsMembersDeleteOK() *PcloudPlacementgroupsMembersDeleteOK { + return &PcloudPlacementgroupsMembersDeleteOK{} +} + +/*PcloudPlacementgroupsMembersDeleteOK handles this case with default header values. + +OK +*/ +type PcloudPlacementgroupsMembersDeleteOK struct { + Payload *models.PlacementGroup +} + +func (o *PcloudPlacementgroupsMembersDeleteOK) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteOK %+v", 200, o.Payload) +} + +func (o *PcloudPlacementgroupsMembersDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PlacementGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsMembersDeleteBadRequest creates a PcloudPlacementgroupsMembersDeleteBadRequest with default headers values +func NewPcloudPlacementgroupsMembersDeleteBadRequest() *PcloudPlacementgroupsMembersDeleteBadRequest { + return &PcloudPlacementgroupsMembersDeleteBadRequest{} +} + +/*PcloudPlacementgroupsMembersDeleteBadRequest handles this case with default header values. + +Bad Request +*/ +type PcloudPlacementgroupsMembersDeleteBadRequest struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsMembersDeleteBadRequest) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteBadRequest %+v", 400, o.Payload) +} + +func (o *PcloudPlacementgroupsMembersDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsMembersDeleteConflict creates a PcloudPlacementgroupsMembersDeleteConflict with default headers values +func NewPcloudPlacementgroupsMembersDeleteConflict() *PcloudPlacementgroupsMembersDeleteConflict { + return &PcloudPlacementgroupsMembersDeleteConflict{} +} + +/*PcloudPlacementgroupsMembersDeleteConflict handles this case with default header values. + +Conflict +*/ +type PcloudPlacementgroupsMembersDeleteConflict struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsMembersDeleteConflict) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteConflict %+v", 409, o.Payload) +} + +func (o *PcloudPlacementgroupsMembersDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsMembersDeleteUnprocessableEntity creates a PcloudPlacementgroupsMembersDeleteUnprocessableEntity with default headers values +func NewPcloudPlacementgroupsMembersDeleteUnprocessableEntity() *PcloudPlacementgroupsMembersDeleteUnprocessableEntity { + return &PcloudPlacementgroupsMembersDeleteUnprocessableEntity{} +} + +/*PcloudPlacementgroupsMembersDeleteUnprocessableEntity handles this case with default header values. + +Unprocessable Entity +*/ +type PcloudPlacementgroupsMembersDeleteUnprocessableEntity struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsMembersDeleteInternalServerError creates a PcloudPlacementgroupsMembersDeleteInternalServerError with default headers values +func NewPcloudPlacementgroupsMembersDeleteInternalServerError() *PcloudPlacementgroupsMembersDeleteInternalServerError { + return &PcloudPlacementgroupsMembersDeleteInternalServerError{} +} + +/*PcloudPlacementgroupsMembersDeleteInternalServerError handles this case with default header values. + +Internal Server Error +*/ +type PcloudPlacementgroupsMembersDeleteInternalServerError struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteInternalServerError %+v", 500, o.Payload) +} + +func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_parameters.go new file mode 100644 index 00000000000..05d85b1aa30 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_parameters.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_placement_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewPcloudPlacementgroupsMembersPostParams creates a new PcloudPlacementgroupsMembersPostParams object +// with the default values initialized. +func NewPcloudPlacementgroupsMembersPostParams() *PcloudPlacementgroupsMembersPostParams { + var () + return &PcloudPlacementgroupsMembersPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudPlacementgroupsMembersPostParamsWithTimeout creates a new PcloudPlacementgroupsMembersPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPcloudPlacementgroupsMembersPostParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsMembersPostParams { + var () + return &PcloudPlacementgroupsMembersPostParams{ + + timeout: timeout, + } +} + +// NewPcloudPlacementgroupsMembersPostParamsWithContext creates a new PcloudPlacementgroupsMembersPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewPcloudPlacementgroupsMembersPostParamsWithContext(ctx context.Context) *PcloudPlacementgroupsMembersPostParams { + var () + return &PcloudPlacementgroupsMembersPostParams{ + + Context: ctx, + } +} + +// NewPcloudPlacementgroupsMembersPostParamsWithHTTPClient creates a new PcloudPlacementgroupsMembersPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPcloudPlacementgroupsMembersPostParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsMembersPostParams { + var () + return &PcloudPlacementgroupsMembersPostParams{ + HTTPClient: client, + } +} + +/*PcloudPlacementgroupsMembersPostParams contains all the parameters to send to the API endpoint +for the pcloud placementgroups members post operation typically these are written to a http.Request +*/ +type PcloudPlacementgroupsMembersPostParams struct { + + /*Body + Parameters for adding a server to a Server Placement Group + + */ + Body *models.PlacementGroupServer + /*CloudInstanceID + Cloud Instance ID of a PCloud Instance + + */ + CloudInstanceID string + /*PlacementGroupID + Placement Group ID + + */ + PlacementGroupID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the pcloud placementgroups members post params +func (o *PcloudPlacementgroupsMembersPostParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsMembersPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud placementgroups members post params +func (o *PcloudPlacementgroupsMembersPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud placementgroups members post params +func (o *PcloudPlacementgroupsMembersPostParams) WithContext(ctx context.Context) *PcloudPlacementgroupsMembersPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud placementgroups members post params +func (o *PcloudPlacementgroupsMembersPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud placementgroups members post params +func (o *PcloudPlacementgroupsMembersPostParams) WithHTTPClient(client *http.Client) *PcloudPlacementgroupsMembersPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud placementgroups members post params +func (o *PcloudPlacementgroupsMembersPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the pcloud placementgroups members post params +func (o *PcloudPlacementgroupsMembersPostParams) WithBody(body *models.PlacementGroupServer) *PcloudPlacementgroupsMembersPostParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the pcloud placementgroups members post params +func (o *PcloudPlacementgroupsMembersPostParams) SetBody(body *models.PlacementGroupServer) { + o.Body = body +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud placementgroups members post params +func (o *PcloudPlacementgroupsMembersPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPlacementgroupsMembersPostParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud placementgroups members post params +func (o *PcloudPlacementgroupsMembersPostParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WithPlacementGroupID adds the placementGroupID to the pcloud placementgroups members post params +func (o *PcloudPlacementgroupsMembersPostParams) WithPlacementGroupID(placementGroupID string) *PcloudPlacementgroupsMembersPostParams { + o.SetPlacementGroupID(placementGroupID) + return o +} + +// SetPlacementGroupID adds the placementGroupId to the pcloud placementgroups members post params +func (o *PcloudPlacementgroupsMembersPostParams) SetPlacementGroupID(placementGroupID string) { + o.PlacementGroupID = placementGroupID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudPlacementgroupsMembersPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + // path param placement_group_id + if err := r.SetPathParam("placement_group_id", o.PlacementGroupID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go new file mode 100644 index 00000000000..fce6e411da0 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_placement_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudPlacementgroupsMembersPostReader is a Reader for the PcloudPlacementgroupsMembersPost structure. +type PcloudPlacementgroupsMembersPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudPlacementgroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewPcloudPlacementgroupsMembersPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPcloudPlacementgroupsMembersPostBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 409: + result := NewPcloudPlacementgroupsMembersPostConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 422: + result := NewPcloudPlacementgroupsMembersPostUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 500: + result := NewPcloudPlacementgroupsMembersPostInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPcloudPlacementgroupsMembersPostOK creates a PcloudPlacementgroupsMembersPostOK with default headers values +func NewPcloudPlacementgroupsMembersPostOK() *PcloudPlacementgroupsMembersPostOK { + return &PcloudPlacementgroupsMembersPostOK{} +} + +/*PcloudPlacementgroupsMembersPostOK handles this case with default header values. + +OK +*/ +type PcloudPlacementgroupsMembersPostOK struct { + Payload *models.PlacementGroup +} + +func (o *PcloudPlacementgroupsMembersPostOK) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostOK %+v", 200, o.Payload) +} + +func (o *PcloudPlacementgroupsMembersPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PlacementGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsMembersPostBadRequest creates a PcloudPlacementgroupsMembersPostBadRequest with default headers values +func NewPcloudPlacementgroupsMembersPostBadRequest() *PcloudPlacementgroupsMembersPostBadRequest { + return &PcloudPlacementgroupsMembersPostBadRequest{} +} + +/*PcloudPlacementgroupsMembersPostBadRequest handles this case with default header values. + +Bad Request +*/ +type PcloudPlacementgroupsMembersPostBadRequest struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsMembersPostBadRequest) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostBadRequest %+v", 400, o.Payload) +} + +func (o *PcloudPlacementgroupsMembersPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsMembersPostConflict creates a PcloudPlacementgroupsMembersPostConflict with default headers values +func NewPcloudPlacementgroupsMembersPostConflict() *PcloudPlacementgroupsMembersPostConflict { + return &PcloudPlacementgroupsMembersPostConflict{} +} + +/*PcloudPlacementgroupsMembersPostConflict handles this case with default header values. + +Conflict +*/ +type PcloudPlacementgroupsMembersPostConflict struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsMembersPostConflict) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostConflict %+v", 409, o.Payload) +} + +func (o *PcloudPlacementgroupsMembersPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsMembersPostUnprocessableEntity creates a PcloudPlacementgroupsMembersPostUnprocessableEntity with default headers values +func NewPcloudPlacementgroupsMembersPostUnprocessableEntity() *PcloudPlacementgroupsMembersPostUnprocessableEntity { + return &PcloudPlacementgroupsMembersPostUnprocessableEntity{} +} + +/*PcloudPlacementgroupsMembersPostUnprocessableEntity handles this case with default header values. + +Unprocessable Entity +*/ +type PcloudPlacementgroupsMembersPostUnprocessableEntity struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsMembersPostInternalServerError creates a PcloudPlacementgroupsMembersPostInternalServerError with default headers values +func NewPcloudPlacementgroupsMembersPostInternalServerError() *PcloudPlacementgroupsMembersPostInternalServerError { + return &PcloudPlacementgroupsMembersPostInternalServerError{} +} + +/*PcloudPlacementgroupsMembersPostInternalServerError handles this case with default header values. + +Internal Server Error +*/ +type PcloudPlacementgroupsMembersPostInternalServerError struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsMembersPostInternalServerError) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostInternalServerError %+v", 500, o.Payload) +} + +func (o *PcloudPlacementgroupsMembersPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_parameters.go new file mode 100644 index 00000000000..edb21247625 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_parameters.go @@ -0,0 +1,160 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_placement_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewPcloudPlacementgroupsPostParams creates a new PcloudPlacementgroupsPostParams object +// with the default values initialized. +func NewPcloudPlacementgroupsPostParams() *PcloudPlacementgroupsPostParams { + var () + return &PcloudPlacementgroupsPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudPlacementgroupsPostParamsWithTimeout creates a new PcloudPlacementgroupsPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPcloudPlacementgroupsPostParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsPostParams { + var () + return &PcloudPlacementgroupsPostParams{ + + timeout: timeout, + } +} + +// NewPcloudPlacementgroupsPostParamsWithContext creates a new PcloudPlacementgroupsPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewPcloudPlacementgroupsPostParamsWithContext(ctx context.Context) *PcloudPlacementgroupsPostParams { + var () + return &PcloudPlacementgroupsPostParams{ + + Context: ctx, + } +} + +// NewPcloudPlacementgroupsPostParamsWithHTTPClient creates a new PcloudPlacementgroupsPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPcloudPlacementgroupsPostParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsPostParams { + var () + return &PcloudPlacementgroupsPostParams{ + HTTPClient: client, + } +} + +/*PcloudPlacementgroupsPostParams contains all the parameters to send to the API endpoint +for the pcloud placementgroups post operation typically these are written to a http.Request +*/ +type PcloudPlacementgroupsPostParams struct { + + /*Body + Parameters for the creation of a new Server Placement Group + + */ + Body *models.PlacementGroupCreate + /*CloudInstanceID + Cloud Instance ID of a PCloud Instance + + */ + CloudInstanceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the pcloud placementgroups post params +func (o *PcloudPlacementgroupsPostParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud placementgroups post params +func (o *PcloudPlacementgroupsPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud placementgroups post params +func (o *PcloudPlacementgroupsPostParams) WithContext(ctx context.Context) *PcloudPlacementgroupsPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud placementgroups post params +func (o *PcloudPlacementgroupsPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud placementgroups post params +func (o *PcloudPlacementgroupsPostParams) WithHTTPClient(client *http.Client) *PcloudPlacementgroupsPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud placementgroups post params +func (o *PcloudPlacementgroupsPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the pcloud placementgroups post params +func (o *PcloudPlacementgroupsPostParams) WithBody(body *models.PlacementGroupCreate) *PcloudPlacementgroupsPostParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the pcloud placementgroups post params +func (o *PcloudPlacementgroupsPostParams) SetBody(body *models.PlacementGroupCreate) { + o.Body = body +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud placementgroups post params +func (o *PcloudPlacementgroupsPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPlacementgroupsPostParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud placementgroups post params +func (o *PcloudPlacementgroupsPostParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudPlacementgroupsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go new file mode 100644 index 00000000000..ff49f94d280 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_placement_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudPlacementgroupsPostReader is a Reader for the PcloudPlacementgroupsPost structure. +type PcloudPlacementgroupsPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudPlacementgroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewPcloudPlacementgroupsPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPcloudPlacementgroupsPostBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 409: + result := NewPcloudPlacementgroupsPostConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 422: + result := NewPcloudPlacementgroupsPostUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 500: + result := NewPcloudPlacementgroupsPostInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPcloudPlacementgroupsPostOK creates a PcloudPlacementgroupsPostOK with default headers values +func NewPcloudPlacementgroupsPostOK() *PcloudPlacementgroupsPostOK { + return &PcloudPlacementgroupsPostOK{} +} + +/*PcloudPlacementgroupsPostOK handles this case with default header values. + +OK +*/ +type PcloudPlacementgroupsPostOK struct { + Payload *models.PlacementGroup +} + +func (o *PcloudPlacementgroupsPostOK) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostOK %+v", 200, o.Payload) +} + +func (o *PcloudPlacementgroupsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PlacementGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsPostBadRequest creates a PcloudPlacementgroupsPostBadRequest with default headers values +func NewPcloudPlacementgroupsPostBadRequest() *PcloudPlacementgroupsPostBadRequest { + return &PcloudPlacementgroupsPostBadRequest{} +} + +/*PcloudPlacementgroupsPostBadRequest handles this case with default header values. + +Bad Request +*/ +type PcloudPlacementgroupsPostBadRequest struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsPostBadRequest) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostBadRequest %+v", 400, o.Payload) +} + +func (o *PcloudPlacementgroupsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsPostConflict creates a PcloudPlacementgroupsPostConflict with default headers values +func NewPcloudPlacementgroupsPostConflict() *PcloudPlacementgroupsPostConflict { + return &PcloudPlacementgroupsPostConflict{} +} + +/*PcloudPlacementgroupsPostConflict handles this case with default header values. + +Conflict +*/ +type PcloudPlacementgroupsPostConflict struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsPostConflict) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostConflict %+v", 409, o.Payload) +} + +func (o *PcloudPlacementgroupsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsPostUnprocessableEntity creates a PcloudPlacementgroupsPostUnprocessableEntity with default headers values +func NewPcloudPlacementgroupsPostUnprocessableEntity() *PcloudPlacementgroupsPostUnprocessableEntity { + return &PcloudPlacementgroupsPostUnprocessableEntity{} +} + +/*PcloudPlacementgroupsPostUnprocessableEntity handles this case with default header values. + +Unprocessable Entity +*/ +type PcloudPlacementgroupsPostUnprocessableEntity struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsPostUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PcloudPlacementgroupsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudPlacementgroupsPostInternalServerError creates a PcloudPlacementgroupsPostInternalServerError with default headers values +func NewPcloudPlacementgroupsPostInternalServerError() *PcloudPlacementgroupsPostInternalServerError { + return &PcloudPlacementgroupsPostInternalServerError{} +} + +/*PcloudPlacementgroupsPostInternalServerError handles this case with default header values. + +Internal Server Error +*/ +type PcloudPlacementgroupsPostInternalServerError struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsPostInternalServerError) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostInternalServerError %+v", 500, o.Payload) +} + +func (o *PcloudPlacementgroupsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go index d6362f7d357..b8215456ed3 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudSapGetReader) ReadResponse(response runtime.ClientResponse, consu } return nil, result + case 401: + result := NewPcloudSapGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudSapGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudSapGetBadRequest) readResponse(response runtime.ClientResponse, c return nil } +// NewPcloudSapGetUnauthorized creates a PcloudSapGetUnauthorized with default headers values +func NewPcloudSapGetUnauthorized() *PcloudSapGetUnauthorized { + return &PcloudSapGetUnauthorized{} +} + +/*PcloudSapGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudSapGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudSapGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudSapGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudSapGetNotFound creates a PcloudSapGetNotFound with default headers values func NewPcloudSapGetNotFound() *PcloudSapGetNotFound { return &PcloudSapGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go index e2cf74fc59f..f2c277b3f15 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudSapGetallReader) ReadResponse(response runtime.ClientResponse, co } return nil, result + case 401: + result := NewPcloudSapGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudSapGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -109,6 +116,35 @@ func (o *PcloudSapGetallBadRequest) readResponse(response runtime.ClientResponse return nil } +// NewPcloudSapGetallUnauthorized creates a PcloudSapGetallUnauthorized with default headers values +func NewPcloudSapGetallUnauthorized() *PcloudSapGetallUnauthorized { + return &PcloudSapGetallUnauthorized{} +} + +/*PcloudSapGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudSapGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudSapGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudSapGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudSapGetallInternalServerError creates a PcloudSapGetallInternalServerError with default headers values func NewPcloudSapGetallInternalServerError() *PcloudSapGetallInternalServerError { return &PcloudSapGetallInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go index d3951686b07..559beea2b36 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go @@ -53,6 +53,13 @@ func (o *PcloudSapPostReader) ReadResponse(response runtime.ClientResponse, cons } return nil, result + case 401: + result := NewPcloudSapPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudSapPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -189,6 +196,35 @@ func (o *PcloudSapPostBadRequest) readResponse(response runtime.ClientResponse, return nil } +// NewPcloudSapPostUnauthorized creates a PcloudSapPostUnauthorized with default headers values +func NewPcloudSapPostUnauthorized() *PcloudSapPostUnauthorized { + return &PcloudSapPostUnauthorized{} +} + +/*PcloudSapPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudSapPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudSapPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudSapPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudSapPostConflict creates a PcloudSapPostConflict with default headers values func NewPcloudSapPostConflict() *PcloudSapPostConflict { return &PcloudSapPostConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go index d87794e51ec..d3ad4507aad 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go @@ -39,6 +39,20 @@ func (o *PcloudCloudinstancesSnapshotsDeleteReader) ReadResponse(response runtim } return nil, result + case 401: + result := NewPcloudCloudinstancesSnapshotsDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 404: + result := NewPcloudCloudinstancesSnapshotsDeleteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: result := NewPcloudCloudinstancesSnapshotsDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +128,64 @@ func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) readResponse(response ru return nil } +// NewPcloudCloudinstancesSnapshotsDeleteUnauthorized creates a PcloudCloudinstancesSnapshotsDeleteUnauthorized with default headers values +func NewPcloudCloudinstancesSnapshotsDeleteUnauthorized() *PcloudCloudinstancesSnapshotsDeleteUnauthorized { + return &PcloudCloudinstancesSnapshotsDeleteUnauthorized{} +} + +/*PcloudCloudinstancesSnapshotsDeleteUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesSnapshotsDeleteUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudCloudinstancesSnapshotsDeleteNotFound creates a PcloudCloudinstancesSnapshotsDeleteNotFound with default headers values +func NewPcloudCloudinstancesSnapshotsDeleteNotFound() *PcloudCloudinstancesSnapshotsDeleteNotFound { + return &PcloudCloudinstancesSnapshotsDeleteNotFound{} +} + +/*PcloudCloudinstancesSnapshotsDeleteNotFound handles this case with default header values. + +Not Found +*/ +type PcloudCloudinstancesSnapshotsDeleteNotFound struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteNotFound %+v", 404, o.Payload) +} + +func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesSnapshotsDeleteGone creates a PcloudCloudinstancesSnapshotsDeleteGone with default headers values func NewPcloudCloudinstancesSnapshotsDeleteGone() *PcloudCloudinstancesSnapshotsDeleteGone { return &PcloudCloudinstancesSnapshotsDeleteGone{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go index 57240c0b985..fc2265ef392 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesSnapshotsGetReader) ReadResponse(response runtime.C } return nil, result + case 401: + result := NewPcloudCloudinstancesSnapshotsGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudCloudinstancesSnapshotsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudCloudinstancesSnapshotsGetBadRequest) readResponse(response runti return nil } +// NewPcloudCloudinstancesSnapshotsGetUnauthorized creates a PcloudCloudinstancesSnapshotsGetUnauthorized with default headers values +func NewPcloudCloudinstancesSnapshotsGetUnauthorized() *PcloudCloudinstancesSnapshotsGetUnauthorized { + return &PcloudCloudinstancesSnapshotsGetUnauthorized{} +} + +/*PcloudCloudinstancesSnapshotsGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesSnapshotsGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesSnapshotsGetNotFound creates a PcloudCloudinstancesSnapshotsGetNotFound with default headers values func NewPcloudCloudinstancesSnapshotsGetNotFound() *PcloudCloudinstancesSnapshotsGetNotFound { return &PcloudCloudinstancesSnapshotsGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go index c557417dca8..43130ea2138 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesSnapshotsGetallReader) ReadResponse(response runtim } return nil, result + case 401: + result := NewPcloudCloudinstancesSnapshotsGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudCloudinstancesSnapshotsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -109,6 +116,35 @@ func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) readResponse(response ru return nil } +// NewPcloudCloudinstancesSnapshotsGetallUnauthorized creates a PcloudCloudinstancesSnapshotsGetallUnauthorized with default headers values +func NewPcloudCloudinstancesSnapshotsGetallUnauthorized() *PcloudCloudinstancesSnapshotsGetallUnauthorized { + return &PcloudCloudinstancesSnapshotsGetallUnauthorized{} +} + +/*PcloudCloudinstancesSnapshotsGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesSnapshotsGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesSnapshotsGetallInternalServerError creates a PcloudCloudinstancesSnapshotsGetallInternalServerError with default headers values func NewPcloudCloudinstancesSnapshotsGetallInternalServerError() *PcloudCloudinstancesSnapshotsGetallInternalServerError { return &PcloudCloudinstancesSnapshotsGetallInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go index 6c8ca7a5ace..9fbccd4cb44 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesSnapshotsPutReader) ReadResponse(response runtime.C } return nil, result + case 401: + result := NewPcloudCloudinstancesSnapshotsPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudCloudinstancesSnapshotsPutNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +121,35 @@ func (o *PcloudCloudinstancesSnapshotsPutBadRequest) readResponse(response runti return nil } +// NewPcloudCloudinstancesSnapshotsPutUnauthorized creates a PcloudCloudinstancesSnapshotsPutUnauthorized with default headers values +func NewPcloudCloudinstancesSnapshotsPutUnauthorized() *PcloudCloudinstancesSnapshotsPutUnauthorized { + return &PcloudCloudinstancesSnapshotsPutUnauthorized{} +} + +/*PcloudCloudinstancesSnapshotsPutUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesSnapshotsPutUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesSnapshotsPutNotFound creates a PcloudCloudinstancesSnapshotsPutNotFound with default headers values func NewPcloudCloudinstancesSnapshotsPutNotFound() *PcloudCloudinstancesSnapshotsPutNotFound { return &PcloudCloudinstancesSnapshotsPutNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go index 44ca460be50..862c1a63500 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go @@ -32,6 +32,13 @@ func (o *PcloudStoragecapacityPoolsGetReader) ReadResponse(response runtime.Clie } return result, nil + case 401: + result := NewPcloudStoragecapacityPoolsGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudStoragecapacityPoolsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -80,6 +87,35 @@ func (o *PcloudStoragecapacityPoolsGetOK) readResponse(response runtime.ClientRe return nil } +// NewPcloudStoragecapacityPoolsGetUnauthorized creates a PcloudStoragecapacityPoolsGetUnauthorized with default headers values +func NewPcloudStoragecapacityPoolsGetUnauthorized() *PcloudStoragecapacityPoolsGetUnauthorized { + return &PcloudStoragecapacityPoolsGetUnauthorized{} +} + +/*PcloudStoragecapacityPoolsGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudStoragecapacityPoolsGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudStoragecapacityPoolsGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudStoragecapacityPoolsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudStoragecapacityPoolsGetNotFound creates a PcloudStoragecapacityPoolsGetNotFound with default headers values func NewPcloudStoragecapacityPoolsGetNotFound() *PcloudStoragecapacityPoolsGetNotFound { return &PcloudStoragecapacityPoolsGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go index b97fe55711e..f62b5831f10 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go @@ -32,6 +32,13 @@ func (o *PcloudStoragecapacityPoolsGetallReader) ReadResponse(response runtime.C } return result, nil + case 401: + result := NewPcloudStoragecapacityPoolsGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudStoragecapacityPoolsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -73,6 +80,35 @@ func (o *PcloudStoragecapacityPoolsGetallOK) readResponse(response runtime.Clien return nil } +// NewPcloudStoragecapacityPoolsGetallUnauthorized creates a PcloudStoragecapacityPoolsGetallUnauthorized with default headers values +func NewPcloudStoragecapacityPoolsGetallUnauthorized() *PcloudStoragecapacityPoolsGetallUnauthorized { + return &PcloudStoragecapacityPoolsGetallUnauthorized{} +} + +/*PcloudStoragecapacityPoolsGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudStoragecapacityPoolsGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudStoragecapacityPoolsGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudStoragecapacityPoolsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudStoragecapacityPoolsGetallInternalServerError creates a PcloudStoragecapacityPoolsGetallInternalServerError with default headers values func NewPcloudStoragecapacityPoolsGetallInternalServerError() *PcloudStoragecapacityPoolsGetallInternalServerError { return &PcloudStoragecapacityPoolsGetallInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go index 9adf16720c8..0ff52a04a4b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go @@ -32,6 +32,13 @@ func (o *PcloudStoragecapacityTypesGetReader) ReadResponse(response runtime.Clie } return result, nil + case 401: + result := NewPcloudStoragecapacityTypesGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudStoragecapacityTypesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -80,6 +87,35 @@ func (o *PcloudStoragecapacityTypesGetOK) readResponse(response runtime.ClientRe return nil } +// NewPcloudStoragecapacityTypesGetUnauthorized creates a PcloudStoragecapacityTypesGetUnauthorized with default headers values +func NewPcloudStoragecapacityTypesGetUnauthorized() *PcloudStoragecapacityTypesGetUnauthorized { + return &PcloudStoragecapacityTypesGetUnauthorized{} +} + +/*PcloudStoragecapacityTypesGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudStoragecapacityTypesGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudStoragecapacityTypesGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudStoragecapacityTypesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudStoragecapacityTypesGetNotFound creates a PcloudStoragecapacityTypesGetNotFound with default headers values func NewPcloudStoragecapacityTypesGetNotFound() *PcloudStoragecapacityTypesGetNotFound { return &PcloudStoragecapacityTypesGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go index 9f6f19e0d5d..88467e7d42d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go @@ -32,6 +32,13 @@ func (o *PcloudStoragecapacityTypesGetallReader) ReadResponse(response runtime.C } return result, nil + case 401: + result := NewPcloudStoragecapacityTypesGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudStoragecapacityTypesGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -73,6 +80,35 @@ func (o *PcloudStoragecapacityTypesGetallOK) readResponse(response runtime.Clien return nil } +// NewPcloudStoragecapacityTypesGetallUnauthorized creates a PcloudStoragecapacityTypesGetallUnauthorized with default headers values +func NewPcloudStoragecapacityTypesGetallUnauthorized() *PcloudStoragecapacityTypesGetallUnauthorized { + return &PcloudStoragecapacityTypesGetallUnauthorized{} +} + +/*PcloudStoragecapacityTypesGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudStoragecapacityTypesGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudStoragecapacityTypesGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudStoragecapacityTypesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudStoragecapacityTypesGetallInternalServerError creates a PcloudStoragecapacityTypesGetallInternalServerError with default headers values func NewPcloudStoragecapacityTypesGetallInternalServerError() *PcloudStoragecapacityTypesGetallInternalServerError { return &PcloudStoragecapacityTypesGetallInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go index 47d0b86c372..2f5aec49ef5 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go @@ -32,6 +32,13 @@ func (o *PcloudSystempoolsGetReader) ReadResponse(response runtime.ClientRespons } return result, nil + case 401: + result := NewPcloudSystempoolsGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudSystempoolsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -71,6 +78,35 @@ func (o *PcloudSystempoolsGetOK) readResponse(response runtime.ClientResponse, c return nil } +// NewPcloudSystempoolsGetUnauthorized creates a PcloudSystempoolsGetUnauthorized with default headers values +func NewPcloudSystempoolsGetUnauthorized() *PcloudSystempoolsGetUnauthorized { + return &PcloudSystempoolsGetUnauthorized{} +} + +/*PcloudSystempoolsGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudSystempoolsGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudSystempoolsGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudSystempoolsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudSystempoolsGetInternalServerError creates a PcloudSystempoolsGetInternalServerError with default headers values func NewPcloudSystempoolsGetInternalServerError() *PcloudSystempoolsGetInternalServerError { return &PcloudSystempoolsGetInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go index 44d5342e9bd..d739a07ed9f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go @@ -39,6 +39,20 @@ func (o *PcloudTasksDeleteReader) ReadResponse(response runtime.ClientResponse, } return nil, result + case 401: + result := NewPcloudTasksDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 404: + result := NewPcloudTasksDeleteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: result := NewPcloudTasksDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +128,64 @@ func (o *PcloudTasksDeleteBadRequest) readResponse(response runtime.ClientRespon return nil } +// NewPcloudTasksDeleteUnauthorized creates a PcloudTasksDeleteUnauthorized with default headers values +func NewPcloudTasksDeleteUnauthorized() *PcloudTasksDeleteUnauthorized { + return &PcloudTasksDeleteUnauthorized{} +} + +/*PcloudTasksDeleteUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudTasksDeleteUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudTasksDeleteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudTasksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudTasksDeleteNotFound creates a PcloudTasksDeleteNotFound with default headers values +func NewPcloudTasksDeleteNotFound() *PcloudTasksDeleteNotFound { + return &PcloudTasksDeleteNotFound{} +} + +/*PcloudTasksDeleteNotFound handles this case with default header values. + +Not Found +*/ +type PcloudTasksDeleteNotFound struct { + Payload *models.Error +} + +func (o *PcloudTasksDeleteNotFound) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteNotFound %+v", 404, o.Payload) +} + +func (o *PcloudTasksDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudTasksDeleteGone creates a PcloudTasksDeleteGone with default headers values func NewPcloudTasksDeleteGone() *PcloudTasksDeleteGone { return &PcloudTasksDeleteGone{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go index f1312b393c6..2315afbbf08 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudTasksGetReader) ReadResponse(response runtime.ClientResponse, con } return nil, result + case 401: + result := NewPcloudTasksGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudTasksGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudTasksGetBadRequest) readResponse(response runtime.ClientResponse, return nil } +// NewPcloudTasksGetUnauthorized creates a PcloudTasksGetUnauthorized with default headers values +func NewPcloudTasksGetUnauthorized() *PcloudTasksGetUnauthorized { + return &PcloudTasksGetUnauthorized{} +} + +/*PcloudTasksGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudTasksGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudTasksGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudTasksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudTasksGetNotFound creates a PcloudTasksGetNotFound with default headers values func NewPcloudTasksGetNotFound() *PcloudTasksGetNotFound { return &PcloudTasksGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go index 04ab304d1c3..1f6d9202145 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go @@ -39,6 +39,20 @@ func (o *PcloudTenantsGetReader) ReadResponse(response runtime.ClientResponse, c } return nil, result + case 401: + result := NewPcloudTenantsGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 403: + result := NewPcloudTenantsGetForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudTenantsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +130,64 @@ func (o *PcloudTenantsGetBadRequest) readResponse(response runtime.ClientRespons return nil } +// NewPcloudTenantsGetUnauthorized creates a PcloudTenantsGetUnauthorized with default headers values +func NewPcloudTenantsGetUnauthorized() *PcloudTenantsGetUnauthorized { + return &PcloudTenantsGetUnauthorized{} +} + +/*PcloudTenantsGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudTenantsGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudTenantsGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudTenantsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudTenantsGetForbidden creates a PcloudTenantsGetForbidden with default headers values +func NewPcloudTenantsGetForbidden() *PcloudTenantsGetForbidden { + return &PcloudTenantsGetForbidden{} +} + +/*PcloudTenantsGetForbidden handles this case with default header values. + +Forbidden +*/ +type PcloudTenantsGetForbidden struct { + Payload *models.Error +} + +func (o *PcloudTenantsGetForbidden) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetForbidden %+v", 403, o.Payload) +} + +func (o *PcloudTenantsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudTenantsGetNotFound creates a PcloudTenantsGetNotFound with default headers values func NewPcloudTenantsGetNotFound() *PcloudTenantsGetNotFound { return &PcloudTenantsGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go index 8fdd1ba1630..d81ccd0f3b6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go @@ -39,6 +39,13 @@ func (o *PcloudTenantsPutReader) ReadResponse(response runtime.ClientResponse, c } return nil, result + case 401: + result := NewPcloudTenantsPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: result := NewPcloudTenantsPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudTenantsPutBadRequest) readResponse(response runtime.ClientRespons return nil } +// NewPcloudTenantsPutUnauthorized creates a PcloudTenantsPutUnauthorized with default headers values +func NewPcloudTenantsPutUnauthorized() *PcloudTenantsPutUnauthorized { + return &PcloudTenantsPutUnauthorized{} +} + +/*PcloudTenantsPutUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudTenantsPutUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudTenantsPutUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudTenantsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudTenantsPutUnprocessableEntity creates a PcloudTenantsPutUnprocessableEntity with default headers values func NewPcloudTenantsPutUnprocessableEntity() *PcloudTenantsPutUnprocessableEntity { return &PcloudTenantsPutUnprocessableEntity{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go index 49583089700..fd350dd982f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go @@ -39,6 +39,13 @@ func (o *PcloudTenantsSshkeysDeleteReader) ReadResponse(response runtime.ClientR } return nil, result + case 401: + result := NewPcloudTenantsSshkeysDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: result := NewPcloudTenantsSshkeysDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +121,35 @@ func (o *PcloudTenantsSshkeysDeleteBadRequest) readResponse(response runtime.Cli return nil } +// NewPcloudTenantsSshkeysDeleteUnauthorized creates a PcloudTenantsSshkeysDeleteUnauthorized with default headers values +func NewPcloudTenantsSshkeysDeleteUnauthorized() *PcloudTenantsSshkeysDeleteUnauthorized { + return &PcloudTenantsSshkeysDeleteUnauthorized{} +} + +/*PcloudTenantsSshkeysDeleteUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudTenantsSshkeysDeleteUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudTenantsSshkeysDeleteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudTenantsSshkeysDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudTenantsSshkeysDeleteGone creates a PcloudTenantsSshkeysDeleteGone with default headers values func NewPcloudTenantsSshkeysDeleteGone() *PcloudTenantsSshkeysDeleteGone { return &PcloudTenantsSshkeysDeleteGone{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go index f49279efa7a..bc40960ed50 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudTenantsSshkeysGetReader) ReadResponse(response runtime.ClientResp } return nil, result + case 401: + result := NewPcloudTenantsSshkeysGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudTenantsSshkeysGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudTenantsSshkeysGetBadRequest) readResponse(response runtime.Client return nil } +// NewPcloudTenantsSshkeysGetUnauthorized creates a PcloudTenantsSshkeysGetUnauthorized with default headers values +func NewPcloudTenantsSshkeysGetUnauthorized() *PcloudTenantsSshkeysGetUnauthorized { + return &PcloudTenantsSshkeysGetUnauthorized{} +} + +/*PcloudTenantsSshkeysGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudTenantsSshkeysGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudTenantsSshkeysGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudTenantsSshkeysGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudTenantsSshkeysGetNotFound creates a PcloudTenantsSshkeysGetNotFound with default headers values func NewPcloudTenantsSshkeysGetNotFound() *PcloudTenantsSshkeysGetNotFound { return &PcloudTenantsSshkeysGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go index 06b31465164..0405bfdb59b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudTenantsSshkeysGetallReader) ReadResponse(response runtime.ClientR } return nil, result + case 401: + result := NewPcloudTenantsSshkeysGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudTenantsSshkeysGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudTenantsSshkeysGetallBadRequest) readResponse(response runtime.Cli return nil } +// NewPcloudTenantsSshkeysGetallUnauthorized creates a PcloudTenantsSshkeysGetallUnauthorized with default headers values +func NewPcloudTenantsSshkeysGetallUnauthorized() *PcloudTenantsSshkeysGetallUnauthorized { + return &PcloudTenantsSshkeysGetallUnauthorized{} +} + +/*PcloudTenantsSshkeysGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudTenantsSshkeysGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudTenantsSshkeysGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudTenantsSshkeysGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudTenantsSshkeysGetallNotFound creates a PcloudTenantsSshkeysGetallNotFound with default headers values func NewPcloudTenantsSshkeysGetallNotFound() *PcloudTenantsSshkeysGetallNotFound { return &PcloudTenantsSshkeysGetallNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go index dbe77406527..53e307ebcbf 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go @@ -46,6 +46,13 @@ func (o *PcloudTenantsSshkeysPostReader) ReadResponse(response runtime.ClientRes } return nil, result + case 401: + result := NewPcloudTenantsSshkeysPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudTenantsSshkeysPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -159,6 +166,35 @@ func (o *PcloudTenantsSshkeysPostBadRequest) readResponse(response runtime.Clien return nil } +// NewPcloudTenantsSshkeysPostUnauthorized creates a PcloudTenantsSshkeysPostUnauthorized with default headers values +func NewPcloudTenantsSshkeysPostUnauthorized() *PcloudTenantsSshkeysPostUnauthorized { + return &PcloudTenantsSshkeysPostUnauthorized{} +} + +/*PcloudTenantsSshkeysPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudTenantsSshkeysPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudTenantsSshkeysPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudTenantsSshkeysPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudTenantsSshkeysPostConflict creates a PcloudTenantsSshkeysPostConflict with default headers values func NewPcloudTenantsSshkeysPostConflict() *PcloudTenantsSshkeysPostConflict { return &PcloudTenantsSshkeysPostConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go index 02a1b32b701..a15df56827c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go @@ -39,6 +39,13 @@ func (o *PcloudTenantsSshkeysPutReader) ReadResponse(response runtime.ClientResp } return nil, result + case 401: + result := NewPcloudTenantsSshkeysPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: result := NewPcloudTenantsSshkeysPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudTenantsSshkeysPutBadRequest) readResponse(response runtime.Client return nil } +// NewPcloudTenantsSshkeysPutUnauthorized creates a PcloudTenantsSshkeysPutUnauthorized with default headers values +func NewPcloudTenantsSshkeysPutUnauthorized() *PcloudTenantsSshkeysPutUnauthorized { + return &PcloudTenantsSshkeysPutUnauthorized{} +} + +/*PcloudTenantsSshkeysPutUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudTenantsSshkeysPutUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudTenantsSshkeysPutUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudTenantsSshkeysPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudTenantsSshkeysPutUnprocessableEntity creates a PcloudTenantsSshkeysPutUnprocessableEntity with default headers values func NewPcloudTenantsSshkeysPutUnprocessableEntity() *PcloudTenantsSshkeysPutUnprocessableEntity { return &PcloudTenantsSshkeysPutUnprocessableEntity{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/p_cloud_volumes_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/p_cloud_volumes_client.go index 1c6a777f64a..03e86ce2e25 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/p_cloud_volumes_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/p_cloud_volumes_client.go @@ -343,6 +343,35 @@ func (a *Client) PcloudPvminstancesVolumesSetbootPut(params *PcloudPvminstancesV } +/* +PcloudV2PvminstancesVolumesPost attaches all volumes to a p VM instance +*/ +func (a *Client) PcloudV2PvminstancesVolumesPost(params *PcloudV2PvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2PvminstancesVolumesPostAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudV2PvminstancesVolumesPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "pcloud.v2.pvminstances.volumes.post", + Method: "POST", + PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudV2PvminstancesVolumesPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PcloudV2PvminstancesVolumesPostAccepted), nil + +} + /* PcloudV2VolumesClonePost creates a volume clone for specified volumes */ diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go index 6978a005a79..25269897841 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesVolumesDeleteReader) ReadResponse(response runtime. } return nil, result + case 401: + result := NewPcloudCloudinstancesVolumesDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: result := NewPcloudCloudinstancesVolumesDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +121,35 @@ func (o *PcloudCloudinstancesVolumesDeleteBadRequest) readResponse(response runt return nil } +// NewPcloudCloudinstancesVolumesDeleteUnauthorized creates a PcloudCloudinstancesVolumesDeleteUnauthorized with default headers values +func NewPcloudCloudinstancesVolumesDeleteUnauthorized() *PcloudCloudinstancesVolumesDeleteUnauthorized { + return &PcloudCloudinstancesVolumesDeleteUnauthorized{} +} + +/*PcloudCloudinstancesVolumesDeleteUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesVolumesDeleteUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesVolumesDeleteGone creates a PcloudCloudinstancesVolumesDeleteGone with default headers values func NewPcloudCloudinstancesVolumesDeleteGone() *PcloudCloudinstancesVolumesDeleteGone { return &PcloudCloudinstancesVolumesDeleteGone{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go index 7bc1023ea50..9f536aebc14 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesVolumesGetReader) ReadResponse(response runtime.Cli } return nil, result + case 401: + result := NewPcloudCloudinstancesVolumesGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudCloudinstancesVolumesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudCloudinstancesVolumesGetBadRequest) readResponse(response runtime return nil } +// NewPcloudCloudinstancesVolumesGetUnauthorized creates a PcloudCloudinstancesVolumesGetUnauthorized with default headers values +func NewPcloudCloudinstancesVolumesGetUnauthorized() *PcloudCloudinstancesVolumesGetUnauthorized { + return &PcloudCloudinstancesVolumesGetUnauthorized{} +} + +/*PcloudCloudinstancesVolumesGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesVolumesGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesVolumesGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesVolumesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesVolumesGetNotFound creates a PcloudCloudinstancesVolumesGetNotFound with default headers values func NewPcloudCloudinstancesVolumesGetNotFound() *PcloudCloudinstancesVolumesGetNotFound { return &PcloudCloudinstancesVolumesGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go index ade48e1cc1b..388793f9e17 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesVolumesGetallReader) ReadResponse(response runtime. } return nil, result + case 401: + result := NewPcloudCloudinstancesVolumesGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudCloudinstancesVolumesGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudCloudinstancesVolumesGetallBadRequest) readResponse(response runt return nil } +// NewPcloudCloudinstancesVolumesGetallUnauthorized creates a PcloudCloudinstancesVolumesGetallUnauthorized with default headers values +func NewPcloudCloudinstancesVolumesGetallUnauthorized() *PcloudCloudinstancesVolumesGetallUnauthorized { + return &PcloudCloudinstancesVolumesGetallUnauthorized{} +} + +/*PcloudCloudinstancesVolumesGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesVolumesGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesVolumesGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesVolumesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesVolumesGetallNotFound creates a PcloudCloudinstancesVolumesGetallNotFound with default headers values func NewPcloudCloudinstancesVolumesGetallNotFound() *PcloudCloudinstancesVolumesGetallNotFound { return &PcloudCloudinstancesVolumesGetallNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go index ace84485189..649f58f589c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesVolumesPostReader) ReadResponse(response runtime.Cl } return nil, result + case 401: + result := NewPcloudCloudinstancesVolumesPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudCloudinstancesVolumesPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -123,6 +130,35 @@ func (o *PcloudCloudinstancesVolumesPostBadRequest) readResponse(response runtim return nil } +// NewPcloudCloudinstancesVolumesPostUnauthorized creates a PcloudCloudinstancesVolumesPostUnauthorized with default headers values +func NewPcloudCloudinstancesVolumesPostUnauthorized() *PcloudCloudinstancesVolumesPostUnauthorized { + return &PcloudCloudinstancesVolumesPostUnauthorized{} +} + +/*PcloudCloudinstancesVolumesPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesVolumesPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesVolumesPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesVolumesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesVolumesPostConflict creates a PcloudCloudinstancesVolumesPostConflict with default headers values func NewPcloudCloudinstancesVolumesPostConflict() *PcloudCloudinstancesVolumesPostConflict { return &PcloudCloudinstancesVolumesPostConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go index bcabbc44b8f..988937c2060 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go @@ -39,6 +39,13 @@ func (o *PcloudCloudinstancesVolumesPutReader) ReadResponse(response runtime.Cli } return nil, result + case 401: + result := NewPcloudCloudinstancesVolumesPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudCloudinstancesVolumesPutConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -123,6 +130,35 @@ func (o *PcloudCloudinstancesVolumesPutBadRequest) readResponse(response runtime return nil } +// NewPcloudCloudinstancesVolumesPutUnauthorized creates a PcloudCloudinstancesVolumesPutUnauthorized with default headers values +func NewPcloudCloudinstancesVolumesPutUnauthorized() *PcloudCloudinstancesVolumesPutUnauthorized { + return &PcloudCloudinstancesVolumesPutUnauthorized{} +} + +/*PcloudCloudinstancesVolumesPutUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesVolumesPutUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudCloudinstancesVolumesPutUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudCloudinstancesVolumesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesVolumesPutConflict creates a PcloudCloudinstancesVolumesPutConflict with default headers values func NewPcloudCloudinstancesVolumesPutConflict() *PcloudCloudinstancesVolumesPutConflict { return &PcloudCloudinstancesVolumesPutConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go index 520403da998..4a52ebd3d1f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesVolumesGetReader) ReadResponse(response runtime.Clien } return nil, result + case 401: + result := NewPcloudPvminstancesVolumesGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudPvminstancesVolumesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudPvminstancesVolumesGetBadRequest) readResponse(response runtime.C return nil } +// NewPcloudPvminstancesVolumesGetUnauthorized creates a PcloudPvminstancesVolumesGetUnauthorized with default headers values +func NewPcloudPvminstancesVolumesGetUnauthorized() *PcloudPvminstancesVolumesGetUnauthorized { + return &PcloudPvminstancesVolumesGetUnauthorized{} +} + +/*PcloudPvminstancesVolumesGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesVolumesGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesVolumesGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesVolumesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesVolumesGetNotFound creates a PcloudPvminstancesVolumesGetNotFound with default headers values func NewPcloudPvminstancesVolumesGetNotFound() *PcloudPvminstancesVolumesGetNotFound { return &PcloudPvminstancesVolumesGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go index 9fb49afeb85..37315da8cc0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesVolumesGetallReader) ReadResponse(response runtime.Cl } return nil, result + case 401: + result := NewPcloudPvminstancesVolumesGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudPvminstancesVolumesGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudPvminstancesVolumesGetallBadRequest) readResponse(response runtim return nil } +// NewPcloudPvminstancesVolumesGetallUnauthorized creates a PcloudPvminstancesVolumesGetallUnauthorized with default headers values +func NewPcloudPvminstancesVolumesGetallUnauthorized() *PcloudPvminstancesVolumesGetallUnauthorized { + return &PcloudPvminstancesVolumesGetallUnauthorized{} +} + +/*PcloudPvminstancesVolumesGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesVolumesGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesVolumesGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesVolumesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesVolumesGetallNotFound creates a PcloudPvminstancesVolumesGetallNotFound with default headers values func NewPcloudPvminstancesVolumesGetallNotFound() *PcloudPvminstancesVolumesGetallNotFound { return &PcloudPvminstancesVolumesGetallNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go index 03d1c0e5166..e34c9623907 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go @@ -39,6 +39,13 @@ func (o *PcloudPvminstancesVolumesSetbootPutReader) ReadResponse(response runtim } return nil, result + case 401: + result := NewPcloudPvminstancesVolumesSetbootPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudPvminstancesVolumesSetbootPutNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +121,35 @@ func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) readResponse(response ru return nil } +// NewPcloudPvminstancesVolumesSetbootPutUnauthorized creates a PcloudPvminstancesVolumesSetbootPutUnauthorized with default headers values +func NewPcloudPvminstancesVolumesSetbootPutUnauthorized() *PcloudPvminstancesVolumesSetbootPutUnauthorized { + return &PcloudPvminstancesVolumesSetbootPutUnauthorized{} +} + +/*PcloudPvminstancesVolumesSetbootPutUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudPvminstancesVolumesSetbootPutUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPvminstancesVolumesSetbootPutNotFound creates a PcloudPvminstancesVolumesSetbootPutNotFound with default headers values func NewPcloudPvminstancesVolumesSetbootPutNotFound() *PcloudPvminstancesVolumesSetbootPutNotFound { return &PcloudPvminstancesVolumesSetbootPutNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_parameters.go new file mode 100644 index 00000000000..a9331aeba0b --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_parameters.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewPcloudV2PvminstancesVolumesPostParams creates a new PcloudV2PvminstancesVolumesPostParams object +// with the default values initialized. +func NewPcloudV2PvminstancesVolumesPostParams() *PcloudV2PvminstancesVolumesPostParams { + var () + return &PcloudV2PvminstancesVolumesPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudV2PvminstancesVolumesPostParamsWithTimeout creates a new PcloudV2PvminstancesVolumesPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPcloudV2PvminstancesVolumesPostParamsWithTimeout(timeout time.Duration) *PcloudV2PvminstancesVolumesPostParams { + var () + return &PcloudV2PvminstancesVolumesPostParams{ + + timeout: timeout, + } +} + +// NewPcloudV2PvminstancesVolumesPostParamsWithContext creates a new PcloudV2PvminstancesVolumesPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewPcloudV2PvminstancesVolumesPostParamsWithContext(ctx context.Context) *PcloudV2PvminstancesVolumesPostParams { + var () + return &PcloudV2PvminstancesVolumesPostParams{ + + Context: ctx, + } +} + +// NewPcloudV2PvminstancesVolumesPostParamsWithHTTPClient creates a new PcloudV2PvminstancesVolumesPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPcloudV2PvminstancesVolumesPostParamsWithHTTPClient(client *http.Client) *PcloudV2PvminstancesVolumesPostParams { + var () + return &PcloudV2PvminstancesVolumesPostParams{ + HTTPClient: client, + } +} + +/*PcloudV2PvminstancesVolumesPostParams contains all the parameters to send to the API endpoint +for the pcloud v2 pvminstances volumes post operation typically these are written to a http.Request +*/ +type PcloudV2PvminstancesVolumesPostParams struct { + + /*Body + Parameter to attach volumes to a PVMInstance + + */ + Body *models.VolumesAttach + /*CloudInstanceID + Cloud Instance ID of a PCloud Instance + + */ + CloudInstanceID string + /*PvmInstanceID + PCloud PVM Instance ID + + */ + PvmInstanceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the pcloud v2 pvminstances volumes post params +func (o *PcloudV2PvminstancesVolumesPostParams) WithTimeout(timeout time.Duration) *PcloudV2PvminstancesVolumesPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud v2 pvminstances volumes post params +func (o *PcloudV2PvminstancesVolumesPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud v2 pvminstances volumes post params +func (o *PcloudV2PvminstancesVolumesPostParams) WithContext(ctx context.Context) *PcloudV2PvminstancesVolumesPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud v2 pvminstances volumes post params +func (o *PcloudV2PvminstancesVolumesPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud v2 pvminstances volumes post params +func (o *PcloudV2PvminstancesVolumesPostParams) WithHTTPClient(client *http.Client) *PcloudV2PvminstancesVolumesPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud v2 pvminstances volumes post params +func (o *PcloudV2PvminstancesVolumesPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the pcloud v2 pvminstances volumes post params +func (o *PcloudV2PvminstancesVolumesPostParams) WithBody(body *models.VolumesAttach) *PcloudV2PvminstancesVolumesPostParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the pcloud v2 pvminstances volumes post params +func (o *PcloudV2PvminstancesVolumesPostParams) SetBody(body *models.VolumesAttach) { + o.Body = body +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 pvminstances volumes post params +func (o *PcloudV2PvminstancesVolumesPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2PvminstancesVolumesPostParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 pvminstances volumes post params +func (o *PcloudV2PvminstancesVolumesPostParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WithPvmInstanceID adds the pvmInstanceID to the pcloud v2 pvminstances volumes post params +func (o *PcloudV2PvminstancesVolumesPostParams) WithPvmInstanceID(pvmInstanceID string) *PcloudV2PvminstancesVolumesPostParams { + o.SetPvmInstanceID(pvmInstanceID) + return o +} + +// SetPvmInstanceID adds the pvmInstanceId to the pcloud v2 pvminstances volumes post params +func (o *PcloudV2PvminstancesVolumesPostParams) SetPvmInstanceID(pvmInstanceID string) { + o.PvmInstanceID = pvmInstanceID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudV2PvminstancesVolumesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + // path param pvm_instance_id + if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go new file mode 100644 index 00000000000..8bb8725272e --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudV2PvminstancesVolumesPostReader is a Reader for the PcloudV2PvminstancesVolumesPost structure. +type PcloudV2PvminstancesVolumesPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudV2PvminstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 202: + result := NewPcloudV2PvminstancesVolumesPostAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPcloudV2PvminstancesVolumesPostBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 401: + result := NewPcloudV2PvminstancesVolumesPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 404: + result := NewPcloudV2PvminstancesVolumesPostNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 500: + result := NewPcloudV2PvminstancesVolumesPostInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPcloudV2PvminstancesVolumesPostAccepted creates a PcloudV2PvminstancesVolumesPostAccepted with default headers values +func NewPcloudV2PvminstancesVolumesPostAccepted() *PcloudV2PvminstancesVolumesPostAccepted { + return &PcloudV2PvminstancesVolumesPostAccepted{} +} + +/*PcloudV2PvminstancesVolumesPostAccepted handles this case with default header values. + +Accepted +*/ +type PcloudV2PvminstancesVolumesPostAccepted struct { + Payload *models.VolumesAttachmentResponse +} + +func (o *PcloudV2PvminstancesVolumesPostAccepted) Error() string { + return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostAccepted %+v", 202, o.Payload) +} + +func (o *PcloudV2PvminstancesVolumesPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VolumesAttachmentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudV2PvminstancesVolumesPostBadRequest creates a PcloudV2PvminstancesVolumesPostBadRequest with default headers values +func NewPcloudV2PvminstancesVolumesPostBadRequest() *PcloudV2PvminstancesVolumesPostBadRequest { + return &PcloudV2PvminstancesVolumesPostBadRequest{} +} + +/*PcloudV2PvminstancesVolumesPostBadRequest handles this case with default header values. + +Bad Request +*/ +type PcloudV2PvminstancesVolumesPostBadRequest struct { + Payload *models.Error +} + +func (o *PcloudV2PvminstancesVolumesPostBadRequest) Error() string { + return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostBadRequest %+v", 400, o.Payload) +} + +func (o *PcloudV2PvminstancesVolumesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudV2PvminstancesVolumesPostUnauthorized creates a PcloudV2PvminstancesVolumesPostUnauthorized with default headers values +func NewPcloudV2PvminstancesVolumesPostUnauthorized() *PcloudV2PvminstancesVolumesPostUnauthorized { + return &PcloudV2PvminstancesVolumesPostUnauthorized{} +} + +/*PcloudV2PvminstancesVolumesPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudV2PvminstancesVolumesPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudV2PvminstancesVolumesPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudV2PvminstancesVolumesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudV2PvminstancesVolumesPostNotFound creates a PcloudV2PvminstancesVolumesPostNotFound with default headers values +func NewPcloudV2PvminstancesVolumesPostNotFound() *PcloudV2PvminstancesVolumesPostNotFound { + return &PcloudV2PvminstancesVolumesPostNotFound{} +} + +/*PcloudV2PvminstancesVolumesPostNotFound handles this case with default header values. + +Not Found +*/ +type PcloudV2PvminstancesVolumesPostNotFound struct { + Payload *models.Error +} + +func (o *PcloudV2PvminstancesVolumesPostNotFound) Error() string { + return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostNotFound %+v", 404, o.Payload) +} + +func (o *PcloudV2PvminstancesVolumesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudV2PvminstancesVolumesPostInternalServerError creates a PcloudV2PvminstancesVolumesPostInternalServerError with default headers values +func NewPcloudV2PvminstancesVolumesPostInternalServerError() *PcloudV2PvminstancesVolumesPostInternalServerError { + return &PcloudV2PvminstancesVolumesPostInternalServerError{} +} + +/*PcloudV2PvminstancesVolumesPostInternalServerError handles this case with default header values. + +Internal Server Error +*/ +type PcloudV2PvminstancesVolumesPostInternalServerError struct { + Payload *models.Error +} + +func (o *PcloudV2PvminstancesVolumesPostInternalServerError) Error() string { + return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostInternalServerError %+v", 500, o.Payload) +} + +func (o *PcloudV2PvminstancesVolumesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go index ea8769645e4..24bb6d00f61 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudV2VolumesClonePostReader) ReadResponse(response runtime.ClientRes } return nil, result + case 401: + result := NewPcloudV2VolumesClonePostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudV2VolumesClonePostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudV2VolumesClonePostBadRequest) readResponse(response runtime.Clien return nil } +// NewPcloudV2VolumesClonePostUnauthorized creates a PcloudV2VolumesClonePostUnauthorized with default headers values +func NewPcloudV2VolumesClonePostUnauthorized() *PcloudV2VolumesClonePostUnauthorized { + return &PcloudV2VolumesClonePostUnauthorized{} +} + +/*PcloudV2VolumesClonePostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudV2VolumesClonePostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudV2VolumesClonePostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudV2VolumesClonePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudV2VolumesClonePostNotFound creates a PcloudV2VolumesClonePostNotFound with default headers values func NewPcloudV2VolumesClonePostNotFound() *PcloudV2VolumesClonePostNotFound { return &PcloudV2VolumesClonePostNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go index ecb1be0fccd..bbba347e5fb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudV2VolumesClonetasksGetReader) ReadResponse(response runtime.Clien } return nil, result + case 401: + result := NewPcloudV2VolumesClonetasksGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudV2VolumesClonetasksGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -123,6 +130,35 @@ func (o *PcloudV2VolumesClonetasksGetBadRequest) readResponse(response runtime.C return nil } +// NewPcloudV2VolumesClonetasksGetUnauthorized creates a PcloudV2VolumesClonetasksGetUnauthorized with default headers values +func NewPcloudV2VolumesClonetasksGetUnauthorized() *PcloudV2VolumesClonetasksGetUnauthorized { + return &PcloudV2VolumesClonetasksGetUnauthorized{} +} + +/*PcloudV2VolumesClonetasksGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudV2VolumesClonetasksGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudV2VolumesClonetasksGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudV2VolumesClonetasksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudV2VolumesClonetasksGetNotFound creates a PcloudV2VolumesClonetasksGetNotFound with default headers values func NewPcloudV2VolumesClonetasksGetNotFound() *PcloudV2VolumesClonetasksGetNotFound { return &PcloudV2VolumesClonetasksGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go index a63631c660d..69414ddb588 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudV2VolumesPostReader) ReadResponse(response runtime.ClientResponse } return nil, result + case 401: + result := NewPcloudV2VolumesPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudV2VolumesPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -46,6 +53,13 @@ func (o *PcloudV2VolumesPostReader) ReadResponse(response runtime.ClientResponse } return nil, result + case 422: + result := NewPcloudV2VolumesPostUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: result := NewPcloudV2VolumesPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +130,35 @@ func (o *PcloudV2VolumesPostBadRequest) readResponse(response runtime.ClientResp return nil } +// NewPcloudV2VolumesPostUnauthorized creates a PcloudV2VolumesPostUnauthorized with default headers values +func NewPcloudV2VolumesPostUnauthorized() *PcloudV2VolumesPostUnauthorized { + return &PcloudV2VolumesPostUnauthorized{} +} + +/*PcloudV2VolumesPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudV2VolumesPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudV2VolumesPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudV2VolumesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudV2VolumesPostConflict creates a PcloudV2VolumesPostConflict with default headers values func NewPcloudV2VolumesPostConflict() *PcloudV2VolumesPostConflict { return &PcloudV2VolumesPostConflict{} @@ -145,6 +188,35 @@ func (o *PcloudV2VolumesPostConflict) readResponse(response runtime.ClientRespon return nil } +// NewPcloudV2VolumesPostUnprocessableEntity creates a PcloudV2VolumesPostUnprocessableEntity with default headers values +func NewPcloudV2VolumesPostUnprocessableEntity() *PcloudV2VolumesPostUnprocessableEntity { + return &PcloudV2VolumesPostUnprocessableEntity{} +} + +/*PcloudV2VolumesPostUnprocessableEntity handles this case with default header values. + +Unprocessable Entity +*/ +type PcloudV2VolumesPostUnprocessableEntity struct { + Payload *models.Error +} + +func (o *PcloudV2VolumesPostUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PcloudV2VolumesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudV2VolumesPostInternalServerError creates a PcloudV2VolumesPostInternalServerError with default headers values func NewPcloudV2VolumesPostInternalServerError() *PcloudV2VolumesPostInternalServerError { return &PcloudV2VolumesPostInternalServerError{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go index 258338e7507..74547a7b7c2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go @@ -32,6 +32,13 @@ func (o *PcloudV2VolumescloneCancelPostReader) ReadResponse(response runtime.Cli } return result, nil + case 401: + result := NewPcloudV2VolumescloneCancelPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudV2VolumescloneCancelPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -80,6 +87,35 @@ func (o *PcloudV2VolumescloneCancelPostAccepted) readResponse(response runtime.C return nil } +// NewPcloudV2VolumescloneCancelPostUnauthorized creates a PcloudV2VolumescloneCancelPostUnauthorized with default headers values +func NewPcloudV2VolumescloneCancelPostUnauthorized() *PcloudV2VolumescloneCancelPostUnauthorized { + return &PcloudV2VolumescloneCancelPostUnauthorized{} +} + +/*PcloudV2VolumescloneCancelPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudV2VolumescloneCancelPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudV2VolumescloneCancelPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudV2VolumescloneCancelPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudV2VolumescloneCancelPostNotFound creates a PcloudV2VolumescloneCancelPostNotFound with default headers values func NewPcloudV2VolumescloneCancelPostNotFound() *PcloudV2VolumescloneCancelPostNotFound { return &PcloudV2VolumescloneCancelPostNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go index f16230f29a7..3869fc69779 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go @@ -39,6 +39,13 @@ func (o *PcloudV2VolumescloneDeleteReader) ReadResponse(response runtime.ClientR } return nil, result + case 401: + result := NewPcloudV2VolumescloneDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudV2VolumescloneDeleteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -114,6 +121,35 @@ func (o *PcloudV2VolumescloneDeleteBadRequest) readResponse(response runtime.Cli return nil } +// NewPcloudV2VolumescloneDeleteUnauthorized creates a PcloudV2VolumescloneDeleteUnauthorized with default headers values +func NewPcloudV2VolumescloneDeleteUnauthorized() *PcloudV2VolumescloneDeleteUnauthorized { + return &PcloudV2VolumescloneDeleteUnauthorized{} +} + +/*PcloudV2VolumescloneDeleteUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudV2VolumescloneDeleteUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudV2VolumescloneDeleteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudV2VolumescloneDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudV2VolumescloneDeleteNotFound creates a PcloudV2VolumescloneDeleteNotFound with default headers values func NewPcloudV2VolumescloneDeleteNotFound() *PcloudV2VolumescloneDeleteNotFound { return &PcloudV2VolumescloneDeleteNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go index 54efc768ad3..d2cb004a62e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudV2VolumescloneExecutePostReader) ReadResponse(response runtime.Cl } return nil, result + case 401: + result := NewPcloudV2VolumescloneExecutePostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudV2VolumescloneExecutePostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudV2VolumescloneExecutePostBadRequest) readResponse(response runtim return nil } +// NewPcloudV2VolumescloneExecutePostUnauthorized creates a PcloudV2VolumescloneExecutePostUnauthorized with default headers values +func NewPcloudV2VolumescloneExecutePostUnauthorized() *PcloudV2VolumescloneExecutePostUnauthorized { + return &PcloudV2VolumescloneExecutePostUnauthorized{} +} + +/*PcloudV2VolumescloneExecutePostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudV2VolumescloneExecutePostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudV2VolumescloneExecutePostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudV2VolumescloneExecutePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudV2VolumescloneExecutePostNotFound creates a PcloudV2VolumescloneExecutePostNotFound with default headers values func NewPcloudV2VolumescloneExecutePostNotFound() *PcloudV2VolumescloneExecutePostNotFound { return &PcloudV2VolumescloneExecutePostNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go index 8122b8b9d79..7de160af61d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go @@ -39,6 +39,13 @@ func (o *PcloudV2VolumescloneGetReader) ReadResponse(response runtime.ClientResp } return nil, result + case 401: + result := NewPcloudV2VolumescloneGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudV2VolumescloneGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudV2VolumescloneGetBadRequest) readResponse(response runtime.Client return nil } +// NewPcloudV2VolumescloneGetUnauthorized creates a PcloudV2VolumescloneGetUnauthorized with default headers values +func NewPcloudV2VolumescloneGetUnauthorized() *PcloudV2VolumescloneGetUnauthorized { + return &PcloudV2VolumescloneGetUnauthorized{} +} + +/*PcloudV2VolumescloneGetUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudV2VolumescloneGetUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudV2VolumescloneGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudV2VolumescloneGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudV2VolumescloneGetNotFound creates a PcloudV2VolumescloneGetNotFound with default headers values func NewPcloudV2VolumescloneGetNotFound() *PcloudV2VolumescloneGetNotFound { return &PcloudV2VolumescloneGetNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go index dcf41fb26ac..e641fecd1bf 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go @@ -39,6 +39,13 @@ func (o *PcloudV2VolumescloneGetallReader) ReadResponse(response runtime.ClientR } return nil, result + case 401: + result := NewPcloudV2VolumescloneGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudV2VolumescloneGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudV2VolumescloneGetallBadRequest) readResponse(response runtime.Cli return nil } +// NewPcloudV2VolumescloneGetallUnauthorized creates a PcloudV2VolumescloneGetallUnauthorized with default headers values +func NewPcloudV2VolumescloneGetallUnauthorized() *PcloudV2VolumescloneGetallUnauthorized { + return &PcloudV2VolumescloneGetallUnauthorized{} +} + +/*PcloudV2VolumescloneGetallUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudV2VolumescloneGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudV2VolumescloneGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudV2VolumescloneGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudV2VolumescloneGetallNotFound creates a PcloudV2VolumescloneGetallNotFound with default headers values func NewPcloudV2VolumescloneGetallNotFound() *PcloudV2VolumescloneGetallNotFound { return &PcloudV2VolumescloneGetallNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go index 0a26fb0797a..027b2c16d59 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudV2VolumesclonePostReader) ReadResponse(response runtime.ClientRes } return nil, result + case 401: + result := NewPcloudV2VolumesclonePostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: result := NewPcloudV2VolumesclonePostForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -123,6 +130,35 @@ func (o *PcloudV2VolumesclonePostBadRequest) readResponse(response runtime.Clien return nil } +// NewPcloudV2VolumesclonePostUnauthorized creates a PcloudV2VolumesclonePostUnauthorized with default headers values +func NewPcloudV2VolumesclonePostUnauthorized() *PcloudV2VolumesclonePostUnauthorized { + return &PcloudV2VolumesclonePostUnauthorized{} +} + +/*PcloudV2VolumesclonePostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudV2VolumesclonePostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudV2VolumesclonePostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudV2VolumesclonePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudV2VolumesclonePostForbidden creates a PcloudV2VolumesclonePostForbidden with default headers values func NewPcloudV2VolumesclonePostForbidden() *PcloudV2VolumesclonePostForbidden { return &PcloudV2VolumesclonePostForbidden{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go index 4848db18761..3024d07f293 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go @@ -32,6 +32,13 @@ func (o *PcloudV2VolumescloneStartPostReader) ReadResponse(response runtime.Clie } return result, nil + case 401: + result := NewPcloudV2VolumescloneStartPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: result := NewPcloudV2VolumescloneStartPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -80,6 +87,35 @@ func (o *PcloudV2VolumescloneStartPostOK) readResponse(response runtime.ClientRe return nil } +// NewPcloudV2VolumescloneStartPostUnauthorized creates a PcloudV2VolumescloneStartPostUnauthorized with default headers values +func NewPcloudV2VolumescloneStartPostUnauthorized() *PcloudV2VolumescloneStartPostUnauthorized { + return &PcloudV2VolumescloneStartPostUnauthorized{} +} + +/*PcloudV2VolumescloneStartPostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudV2VolumescloneStartPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudV2VolumescloneStartPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudV2VolumescloneStartPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudV2VolumescloneStartPostNotFound creates a PcloudV2VolumescloneStartPostNotFound with default headers values func NewPcloudV2VolumescloneStartPostNotFound() *PcloudV2VolumescloneStartPostNotFound { return &PcloudV2VolumescloneStartPostNotFound{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go index ea9f31799ea..261be98dccf 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go @@ -39,6 +39,13 @@ func (o *PcloudVolumesClonePostReader) ReadResponse(response runtime.ClientRespo } return nil, result + case 401: + result := NewPcloudVolumesClonePostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: result := NewPcloudVolumesClonePostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,6 +123,35 @@ func (o *PcloudVolumesClonePostBadRequest) readResponse(response runtime.ClientR return nil } +// NewPcloudVolumesClonePostUnauthorized creates a PcloudVolumesClonePostUnauthorized with default headers values +func NewPcloudVolumesClonePostUnauthorized() *PcloudVolumesClonePostUnauthorized { + return &PcloudVolumesClonePostUnauthorized{} +} + +/*PcloudVolumesClonePostUnauthorized handles this case with default header values. + +Unauthorized +*/ +type PcloudVolumesClonePostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudVolumesClonePostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostUnauthorized %+v", 401, o.Payload) +} + +func (o *PcloudVolumesClonePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudVolumesClonePostConflict creates a PcloudVolumesClonePostConflict with default headers values func NewPcloudVolumesClonePostConflict() *PcloudVolumesClonePostConflict { return &PcloudVolumesClonePostConflict{} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_client.go index 71edfb8da01..743659404dc 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_client.go @@ -23,6 +23,7 @@ import ( "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity" @@ -104,6 +105,8 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaas cli.PCloudPVMInstances = p_cloud_p_vm_instances.New(transport, formats) + cli.PCloudPlacementGroups = p_cloud_placement_groups.New(transport, formats) + cli.PCloudSAP = p_cloud_s_a_p.New(transport, formats) cli.PCloudSnapshots = p_cloud_snapshots.New(transport, formats) @@ -196,6 +199,8 @@ type PowerIaas struct { PCloudPVMInstances *p_cloud_p_vm_instances.Client + PCloudPlacementGroups *p_cloud_placement_groups.Client + PCloudSAP *p_cloud_s_a_p.Client PCloudSnapshots *p_cloud_snapshots.Client @@ -251,6 +256,8 @@ func (c *PowerIaas) SetTransport(transport runtime.ClientTransport) { c.PCloudPVMInstances.SetTransport(transport) + c.PCloudPlacementGroups.SetTransport(transport) + c.PCloudSAP.SetTransport(transport) c.PCloudSnapshots.SetTransport(transport) diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create.go index 25d7a4c44e5..22f566f4e84 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -18,7 +20,7 @@ import ( type CloudConnectionCreate struct { // classic - Classic *CloudConnectionEndpointClassic `json:"classic,omitempty"` + Classic *CloudConnectionEndpointClassicUpdate `json:"classic,omitempty"` // enable global routing for this cloud connection (default=false) GlobalRouting bool `json:"globalRouting,omitempty"` @@ -32,8 +34,12 @@ type CloudConnectionCreate struct { // speed of the cloud connection (speed in megabits per second) // Required: true + // Enum: [50 100 200 500 1000 2000 5000 10000] Speed *int64 `json:"speed"` + // list of subnets to attach to cloud connection + Subnets []string `json:"subnets"` + // vpc Vpc *CloudConnectionEndpointVPC `json:"vpc,omitempty"` } @@ -91,12 +97,37 @@ func (m *CloudConnectionCreate) validateName(formats strfmt.Registry) error { return nil } +var cloudConnectionCreateTypeSpeedPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[50,100,200,500,1000,2000,5000,10000]`), &res); err != nil { + panic(err) + } + for _, v := range res { + cloudConnectionCreateTypeSpeedPropEnum = append(cloudConnectionCreateTypeSpeedPropEnum, v) + } +} + +// prop value enum +func (m *CloudConnectionCreate) validateSpeedEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, cloudConnectionCreateTypeSpeedPropEnum); err != nil { + return err + } + return nil +} + func (m *CloudConnectionCreate) validateSpeed(formats strfmt.Registry) error { if err := validate.Required("speed", "body", m.Speed); err != nil { return err } + // value enum + if err := m.validateSpeedEnum("speed", "body", *m.Speed); err != nil { + return err + } + return nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic.go index 74b1c934f48..3ff28f5b938 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic.go @@ -20,7 +20,7 @@ type CloudConnectionEndpointClassic struct { Enabled bool `json:"enabled"` // gre - Gre *CloudConnectionEndpointGRE `json:"gre,omitempty"` + Gre *CloudConnectionGRETunnel `json:"gre,omitempty"` } // Validate validates this cloud connection endpoint classic diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic_update.go new file mode 100644 index 00000000000..97a3ad65d04 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic_update.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// CloudConnectionEndpointClassicUpdate cloud connection endpoint classic update +// swagger:model CloudConnectionEndpointClassicUpdate +type CloudConnectionEndpointClassicUpdate struct { + + // enable classic endpoint destination (default=false) + Enabled bool `json:"enabled"` + + // gre + Gre *CloudConnectionGRETunnelCreate `json:"gre,omitempty"` +} + +// Validate validates this cloud connection endpoint classic update +func (m *CloudConnectionEndpointClassicUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateGre(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudConnectionEndpointClassicUpdate) validateGre(formats strfmt.Registry) error { + + if swag.IsZero(m.Gre) { // not required + return nil + } + + if m.Gre != nil { + if err := m.Gre.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("gre") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CloudConnectionEndpointClassicUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CloudConnectionEndpointClassicUpdate) UnmarshalBinary(b []byte) error { + var res CloudConnectionEndpointClassicUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_g_r_e.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_g_r_e.go deleted file mode 100644 index 19d235a6d7c..00000000000 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_g_r_e.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// CloudConnectionEndpointGRE cloud connection endpoint g r e -// swagger:model CloudConnectionEndpointGRE -type CloudConnectionEndpointGRE struct { - - // enable gre for this cloud connection (default=false) - Enabled bool `json:"enabled,omitempty"` - - // gre tunnels configured - Tunnels []*CloudConnectionGRETunnel `json:"tunnels"` -} - -// Validate validates this cloud connection endpoint g r e -func (m *CloudConnectionEndpointGRE) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTunnels(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionEndpointGRE) validateTunnels(formats strfmt.Registry) error { - - if swag.IsZero(m.Tunnels) { // not required - return nil - } - - for i := 0; i < len(m.Tunnels); i++ { - if swag.IsZero(m.Tunnels[i]) { // not required - continue - } - - if m.Tunnels[i] != nil { - if err := m.Tunnels[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tunnels" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnectionEndpointGRE) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnectionEndpointGRE) UnmarshalBinary(b []byte) error { - var res CloudConnectionEndpointGRE - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel.go index 2775719391e..8a41269bf46 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel.go @@ -17,27 +17,24 @@ import ( // swagger:model CloudConnectionGRETunnel type CloudConnectionGRETunnel struct { - // gre network in CIDR notation (192.168.0.0/24) - // Required: true - Cidr *string `json:"cidr"` - // gre destination IP address // Required: true DestIPAddress *string `json:"destIPAddress"` // gre auto-assigned source IP address - SourceIPAddress string `json:"sourceIPAddress,omitempty"` + // Required: true + SourceIPAddress *string `json:"sourceIPAddress"` } // Validate validates this cloud connection g r e tunnel func (m *CloudConnectionGRETunnel) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateCidr(formats); err != nil { + if err := m.validateDestIPAddress(formats); err != nil { res = append(res, err) } - if err := m.validateDestIPAddress(formats); err != nil { + if err := m.validateSourceIPAddress(formats); err != nil { res = append(res, err) } @@ -47,18 +44,18 @@ func (m *CloudConnectionGRETunnel) Validate(formats strfmt.Registry) error { return nil } -func (m *CloudConnectionGRETunnel) validateCidr(formats strfmt.Registry) error { +func (m *CloudConnectionGRETunnel) validateDestIPAddress(formats strfmt.Registry) error { - if err := validate.Required("cidr", "body", m.Cidr); err != nil { + if err := validate.Required("destIPAddress", "body", m.DestIPAddress); err != nil { return err } return nil } -func (m *CloudConnectionGRETunnel) validateDestIPAddress(formats strfmt.Registry) error { +func (m *CloudConnectionGRETunnel) validateSourceIPAddress(formats strfmt.Registry) error { - if err := validate.Required("destIPAddress", "body", m.DestIPAddress); err != nil { + if err := validate.Required("sourceIPAddress", "body", m.SourceIPAddress); err != nil { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel_create.go new file mode 100644 index 00000000000..7ad4526cb91 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel_create.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CloudConnectionGRETunnelCreate cloud connection g r e tunnel create +// swagger:model CloudConnectionGRETunnelCreate +type CloudConnectionGRETunnelCreate struct { + + // gre network in CIDR notation (192.168.0.0/24) + // Required: true + Cidr *string `json:"cidr"` + + // gre destination IP address + // Required: true + DestIPAddress *string `json:"destIPAddress"` +} + +// Validate validates this cloud connection g r e tunnel create +func (m *CloudConnectionGRETunnelCreate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCidr(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestIPAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudConnectionGRETunnelCreate) validateCidr(formats strfmt.Registry) error { + + if err := validate.Required("cidr", "body", m.Cidr); err != nil { + return err + } + + return nil +} + +func (m *CloudConnectionGRETunnelCreate) validateDestIPAddress(formats strfmt.Registry) error { + + if err := validate.Required("destIPAddress", "body", m.DestIPAddress); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CloudConnectionGRETunnelCreate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CloudConnectionGRETunnelCreate) UnmarshalBinary(b []byte) error { + var res CloudConnectionGRETunnelCreate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_speed.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_speed.go new file mode 100644 index 00000000000..8ff04b5289a --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_speed.go @@ -0,0 +1,54 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/validate" +) + +// CloudConnectionSpeed cloud connection speed +// swagger:model CloudConnectionSpeed +type CloudConnectionSpeed int64 + +// for schema +var cloudConnectionSpeedEnum []interface{} + +func init() { + var res []CloudConnectionSpeed + if err := json.Unmarshal([]byte(`[50,100,200,500,1000,2000,5000,10000]`), &res); err != nil { + panic(err) + } + for _, v := range res { + cloudConnectionSpeedEnum = append(cloudConnectionSpeedEnum, v) + } +} + +func (m CloudConnectionSpeed) validateCloudConnectionSpeedEnum(path, location string, value CloudConnectionSpeed) error { + if err := validate.Enum(path, location, value, cloudConnectionSpeedEnum); err != nil { + return err + } + return nil +} + +// Validate validates this cloud connection speed +func (m CloudConnectionSpeed) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateCloudConnectionSpeedEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_update.go index 070758a2be9..bcb428800f2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_update.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_update.go @@ -6,10 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // CloudConnectionUpdate cloud connection update @@ -17,7 +20,7 @@ import ( type CloudConnectionUpdate struct { // classic - Classic *CloudConnectionEndpointClassic `json:"classic,omitempty"` + Classic *CloudConnectionEndpointClassicUpdate `json:"classic,omitempty"` // enable global routing for this cloud connection (default=false) GlobalRouting *bool `json:"globalRouting,omitempty"` @@ -29,6 +32,7 @@ type CloudConnectionUpdate struct { Name *string `json:"name,omitempty"` // speed of the cloud connection (speed in megabits per second) + // Enum: [50 100 200 500 1000 2000 5000 10000] Speed *int64 `json:"speed,omitempty"` // vpc @@ -43,6 +47,10 @@ func (m *CloudConnectionUpdate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateSpeed(formats); err != nil { + res = append(res, err) + } + if err := m.validateVpc(formats); err != nil { res = append(res, err) } @@ -71,6 +79,40 @@ func (m *CloudConnectionUpdate) validateClassic(formats strfmt.Registry) error { return nil } +var cloudConnectionUpdateTypeSpeedPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[50,100,200,500,1000,2000,5000,10000]`), &res); err != nil { + panic(err) + } + for _, v := range res { + cloudConnectionUpdateTypeSpeedPropEnum = append(cloudConnectionUpdateTypeSpeedPropEnum, v) + } +} + +// prop value enum +func (m *CloudConnectionUpdate) validateSpeedEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, cloudConnectionUpdateTypeSpeedPropEnum); err != nil { + return err + } + return nil +} + +func (m *CloudConnectionUpdate) validateSpeed(formats strfmt.Registry) error { + + if swag.IsZero(m.Speed) { // not required + return nil + } + + // value enum + if err := m.validateSpeedEnum("speed", "body", *m.Speed); err != nil { + return err + } + + return nil +} + func (m *CloudConnectionUpdate) validateVpc(formats strfmt.Registry) error { if swag.IsZero(m.Vpc) { // not required diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_virtual_private_clouds.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_virtual_private_clouds.go index fbda0226f87..edd49910152 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_virtual_private_clouds.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_virtual_private_clouds.go @@ -85,6 +85,10 @@ func (m *CloudConnectionVirtualPrivateClouds) UnmarshalBinary(b []byte) error { // swagger:model CloudConnectionVirtualPrivateCloud type CloudConnectionVirtualPrivateCloud struct { + // indicates if vpc uses classic architecture + // Required: true + ClassicAccess *bool `json:"classicAccess"` + // name for the vpc // Required: true Name *string `json:"name"` @@ -102,6 +106,10 @@ type CloudConnectionVirtualPrivateCloud struct { func (m *CloudConnectionVirtualPrivateCloud) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateClassicAccess(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -120,6 +128,15 @@ func (m *CloudConnectionVirtualPrivateCloud) Validate(formats strfmt.Registry) e return nil } +func (m *CloudConnectionVirtualPrivateCloud) validateClassicAccess(formats strfmt.Registry) error { + + if err := validate.Required("classicAccess", "body", m.ClassicAccess); err != nil { + return err + } + + return nil +} + func (m *CloudConnectionVirtualPrivateCloud) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_data_volume.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_data_volume.go index d5b8545fdb6..8c1a4a6e6d6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_data_volume.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_data_volume.go @@ -19,16 +19,22 @@ import ( // swagger:model CreateDataVolume type CreateDataVolume struct { - // PVM Instance (ID or Name) to base volume affinity policy against; required if affinityPolicy is provided and affinityVolume is not provided + // PVM Instance (ID or Name) to base volume affinity policy against; required if requesting affinity and affinityVolume is not provided AffinityPVMInstance *string `json:"affinityPVMInstance,omitempty"` - // Affinity policy for data volume being created; requires affinityPVMInstance or affinityVolume to be specified; ignored if volumePool provided + // Affinity policy for data volume being created; ignored if volumePool provided; for policy affinity requires one of affinityPVMInstance or affinityVolume to be specified; for policy anti-affinity requires one of antiAffinityPVMInstances or antiAffinityVolumes to be specified // Enum: [affinity anti-affinity] AffinityPolicy *string `json:"affinityPolicy,omitempty"` - // Volume (ID or Name) to base volume affinity policy against; required if affinityPolicy is provided and affinityPVMInstance is not provided + // Volume (ID or Name) to base volume affinity policy against; required if requesting affinity and affinityPVMInstance is not provided AffinityVolume *string `json:"affinityVolume,omitempty"` + // List of pvmInstances to base volume anti-affinity policy against; required if requesting anti-affinity and antiAffinityVolumes is not provided + AntiAffinityPVMInstances []string `json:"antiAffinityPVMInstances"` + + // List of volumes to base volume anti-affinity policy against; required if requesting anti-affinity and antiAffinityPVMInstances is not provided + AntiAffinityVolumes []string `json:"antiAffinityVolumes"` + // Type of Disk, required if affinityPolicy and volumePool not provided, otherwise ignored DiskType string `json:"diskType,omitempty"` diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_image.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_image.go index 080f1d1fa15..165bf9963e4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_image.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_image.go @@ -25,7 +25,7 @@ type CreateImage struct { // Cloud Storage bucket name; bucket-name[/optional/folder]; required for import image BucketName string `json:"bucketName,omitempty"` - // Type of Disk + // Type of Disk; will be ignored if storagePool or affinityPolicy is provided DiskType string `json:"diskType,omitempty"` // Cloud Storage image filename; required for import image @@ -54,6 +54,12 @@ type CreateImage struct { // Required: true // Enum: [root-project url] Source *string `json:"source"` + + // The storage affinity data + StorageAffinity *StorageAffinity `json:"storageAffinity,omitempty"` + + // Storage pool where the image will be loaded, used only when importing an image from cloud storage; If provided then affinityPolicy and diskType will be ignored + StoragePool string `json:"storagePool,omitempty"` } // Validate validates this create image @@ -68,6 +74,10 @@ func (m *CreateImage) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateStorageAffinity(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -166,6 +176,24 @@ func (m *CreateImage) validateSource(formats strfmt.Registry) error { return nil } +func (m *CreateImage) validateStorageAffinity(formats strfmt.Registry) error { + + if swag.IsZero(m.StorageAffinity) { // not required + return nil + } + + if m.StorageAffinity != nil { + if err := m.StorageAffinity.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageAffinity") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *CreateImage) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/multi_volumes_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/multi_volumes_create.go index c6d33d68dea..2fa3ffc2203 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/multi_volumes_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/multi_volumes_create.go @@ -19,16 +19,22 @@ import ( // swagger:model MultiVolumesCreate type MultiVolumesCreate struct { - // PVM Instance (ID or Name)to base volume affinity policy against; required if affinityPolicy is provided and affinityVolume is not provided + // PVM Instance (ID or Name)to base volume affinity policy against; required if requesting affinity and affinityVolume is not provided AffinityPVMInstance *string `json:"affinityPVMInstance,omitempty"` - // Affinity policy for data volume being created; requires affinityPVMInstance or affinityVolume to be specified; ignored if volumePool provided + // Affinity policy for data volume being created; ignored if volumePool provided; for policy affinity requires one of affinityPVMInstance or affinityVolume to be specified; for policy anti-affinity requires one of antiAffinityPVMInstances or antiAffinityVolumes to be specified // Enum: [affinity anti-affinity] AffinityPolicy *string `json:"affinityPolicy,omitempty"` - // Volume (ID or Name) to base volume affinity policy against; required if affinityPolicy is provided and affinityPVMInstance is not provided + // Volume (ID or Name) to base volume affinity policy against; required if requesting affinity and affinityPVMInstance is not provided AffinityVolume *string `json:"affinityVolume,omitempty"` + // List of pvmInstances to base volume anti-affinity policy against; required if requesting anti-affinity and antiAffinityVolumes is not provided + AntiAffinityPVMInstances []string `json:"antiAffinityPVMInstances"` + + // List of volumes to base volume anti-affinity policy against; required if requesting anti-affinity and antiAffinityPVMInstances is not provided + AntiAffinityVolumes []string `json:"antiAffinityVolumes"` + // Number of volumes to create Count int64 `json:"count,omitempty"` diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/owner_info.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/owner_info.go index 021980fa029..fecd20461bb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/owner_info.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/owner_info.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -41,10 +43,13 @@ type OwnerInfo struct { // Required: true Name *string `json:"name"` - // Array of Soft Layer IDs - // Required: true + // (deprecated - replaced by softlayerSubscriptions) Array of Soft Layer IDs SoftlayerIds []string `json:"softlayerIDs"` + // Array of softlayer subscriptions + // Required: true + SoftlayerSubscriptions []*SoftlayerSubscription `json:"softlayerSubscriptions"` + // User id of user // Required: true UserID *string `json:"userID"` @@ -78,7 +83,7 @@ func (m *OwnerInfo) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateSoftlayerIds(formats); err != nil { + if err := m.validateSoftlayerSubscriptions(formats); err != nil { res = append(res, err) } @@ -146,12 +151,28 @@ func (m *OwnerInfo) validateName(formats strfmt.Registry) error { return nil } -func (m *OwnerInfo) validateSoftlayerIds(formats strfmt.Registry) error { +func (m *OwnerInfo) validateSoftlayerSubscriptions(formats strfmt.Registry) error { - if err := validate.Required("softlayerIDs", "body", m.SoftlayerIds); err != nil { + if err := validate.Required("softlayerSubscriptions", "body", m.SoftlayerSubscriptions); err != nil { return err } + for i := 0; i < len(m.SoftlayerSubscriptions); i++ { + if swag.IsZero(m.SoftlayerSubscriptions[i]) { // not required + continue + } + + if m.SoftlayerSubscriptions[i] != nil { + if err := m.SoftlayerSubscriptions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("softlayerSubscriptions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + return nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance.go index ac2720e5149..96c73d7f263 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance.go @@ -41,6 +41,9 @@ type PVMInstance struct { // Required: true ImageID *string `json:"imageID"` + // The VTL license repository capacity TB value + LicenseRepositoryCapacity int64 `json:"licenseRepositoryCapacity,omitempty"` + // Maximum amount of memory that can be allocated (in GB, for resize) Maxmem float64 `json:"maxmem,omitempty"` @@ -70,16 +73,19 @@ type PVMInstance struct { // OS system information (usually version and build) OperatingSystem string `json:"operatingSystem,omitempty"` - // Type of the OS [aix, ibmi, redhat, sles] + // Type of the OS [aix, ibmi, redhat, sles, vtl] // Required: true OsType *string `json:"osType"` // VM pinning policy to use [none, soft, hard] PinPolicy string `json:"pinPolicy,omitempty"` + // The placement group of the server + PlacementGroup *string `json:"placementGroup,omitempty"` + // Processor type (dedicated, shared, capped) // Required: true - // Enum: [dedicated shared capped] + // Enum: [dedicated shared capped ] ProcType *string `json:"procType"` // Number of processors allocated @@ -110,6 +116,12 @@ type PVMInstance struct { // Required: true Status *string `json:"status"` + // Storage Pool where server is deployed + StoragePool string `json:"storagePool,omitempty"` + + // Indicates if all volumes attached to the server must reside in the same storage pool + StoragePoolAffinity *bool `json:"storagePoolAffinity,omitempty"` + // Storage type where server is deployed // Required: true StorageType *string `json:"storageType"` @@ -375,7 +387,7 @@ var pVmInstanceTypeProcTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["dedicated","shared","capped"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["dedicated","shared","capped",""]`), &res); err != nil { panic(err) } for _, v := range res { @@ -393,6 +405,9 @@ const ( // PVMInstanceProcTypeCapped captures enum value "capped" PVMInstanceProcTypeCapped string = "capped" + + // PVMInstanceProcType captures enum value "" + PVMInstanceProcType string = "" ) // prop value enum diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_create.go index 08ce25af0e6..277b39e9a34 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_create.go @@ -27,6 +27,9 @@ type PVMInstanceCreate struct { // The name of the SSH key pair provided to the server for authenticating users (looked up in the tenant's list of keys) KeyPairName string `json:"keyPairName,omitempty"` + // The VTL license repository capacity TB value + LicenseRepositoryCapacity int64 `json:"licenseRepositoryCapacity,omitempty"` + // Amount of memory allocated (in GB) // Required: true Memory *float64 `json:"memory"` @@ -43,6 +46,9 @@ type PVMInstanceCreate struct { // pin policy PinPolicy PinPolicy `json:"pinPolicy,omitempty"` + // The placement group for the server + PlacementGroup string `json:"placementGroup,omitempty"` + // Processor type (dedicated, shared, capped) // Required: true // Enum: [dedicated shared capped] @@ -70,7 +76,13 @@ type PVMInstanceCreate struct { // The pvm instance Software Licenses SoftwareLicenses *SoftwareLicenses `json:"softwareLicenses,omitempty"` - // Storage type for server deployment + // The storage affinity data + StorageAffinity *StorageAffinity `json:"storageAffinity,omitempty"` + + // Storage Pool for server deployment; if provided then storageAffinityPolicy and storageType will be ignored + StoragePool string `json:"storagePool,omitempty"` + + // Storage type for server deployment; will be ignored if storagePool or storageAffinityPolicy is provided StorageType string `json:"storageType,omitempty"` // System type used to host the instance @@ -130,6 +142,10 @@ func (m *PVMInstanceCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateStorageAffinity(formats); err != nil { + res = append(res, err) + } + if err := m.validateVirtualCores(formats); err != nil { res = append(res, err) } @@ -370,6 +386,24 @@ func (m *PVMInstanceCreate) validateSoftwareLicenses(formats strfmt.Registry) er return nil } +func (m *PVMInstanceCreate) validateStorageAffinity(formats strfmt.Registry) error { + + if swag.IsZero(m.StorageAffinity) { // not required + return nil + } + + if m.StorageAffinity != nil { + if err := m.StorageAffinity.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageAffinity") + } + return err + } + } + + return nil +} + func (m *PVMInstanceCreate) validateVirtualCores(formats strfmt.Registry) error { if swag.IsZero(m.VirtualCores) { // not required diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference.go index c3d92bcb893..119ea04c8f1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference.go @@ -45,6 +45,9 @@ type PVMInstanceReference struct { // Required: true ImageID *string `json:"imageID"` + // The VTL license repository capacity TB value + LicenseRepositoryCapacity int64 `json:"licenseRepositoryCapacity,omitempty"` + // Maximum amount of memory that can be allocated (in GB, for resize) Maxmem float64 `json:"maxmem,omitempty"` @@ -67,7 +70,7 @@ type PVMInstanceReference struct { // OS system information (usually version and build) OperatingSystem string `json:"operatingSystem,omitempty"` - // Type of the OS [aix, ibmi, redhat, sles] + // Type of the OS [aix, ibmi, redhat, sles, vtl] // Required: true OsType *string `json:"osType"` @@ -107,6 +110,15 @@ type PVMInstanceReference struct { // Required: true Status *string `json:"status"` + // Storage Pool where server is deployed + StoragePool string `json:"storagePool,omitempty"` + + // Indicates if all volumes attached to the server must reside in the same storage pool + StoragePoolAffinity *bool `json:"storagePoolAffinity,omitempty"` + + // Storage type of the deployment storage pool + StorageType string `json:"storageType,omitempty"` + // System type used to host the instance SysType string `json:"sysType,omitempty"` diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update.go index cb997f2c487..d9590d845f0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update.go @@ -19,6 +19,9 @@ import ( // swagger:model PVMInstanceUpdate type PVMInstanceUpdate struct { + // The VTL license repository capacity TB value + LicenseRepositoryCapacity int64 `json:"licenseRepositoryCapacity,omitempty"` + // Amount of memory allocated (in GB) Memory float64 `json:"memory,omitempty"` @@ -44,6 +47,9 @@ type PVMInstanceUpdate struct { // The pvm instance Software Licenses SoftwareLicenses *SoftwareLicenses `json:"softwareLicenses,omitempty"` + // Indicates if all volumes attached to the server must reside in the same storage pool + StoragePoolAffinity *bool `json:"storagePoolAffinity,omitempty"` + // The pvm instance virtual CPU information VirtualCores *VirtualCores `json:"virtualCores,omitempty"` } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update_response.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update_response.go index 23dee315d66..029f7f1bc2d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update_response.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update_response.go @@ -19,6 +19,9 @@ import ( // swagger:model PVMInstanceUpdateResponse type PVMInstanceUpdateResponse struct { + // The VTL license repository capacity TB value + LicenseRepositoryCapacity int64 `json:"licenseRepositoryCapacity,omitempty"` + // Amount of memory allocated (in GB) Memory float64 `json:"memory,omitempty"` diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group.go new file mode 100644 index 00000000000..dcd75772a59 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PlacementGroup placement group +// swagger:model PlacementGroup +type PlacementGroup struct { + + // The id of the Placement Group + // Required: true + ID *string `json:"id"` + + // The List of PVM Instance IDs associated with the Placement Group + // Required: true + Members []string `json:"members"` + + // The name of the Placement Group + // Required: true + Name *string `json:"name"` + + // The Placement Group Policy + // Required: true + // Enum: [affinity anti-affinity] + Policy *string `json:"policy"` +} + +// Validate validates this placement group +func (m *PlacementGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMembers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePolicy(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PlacementGroup) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *PlacementGroup) validateMembers(formats strfmt.Registry) error { + + if err := validate.Required("members", "body", m.Members); err != nil { + return err + } + + return nil +} + +func (m *PlacementGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +var placementGroupTypePolicyPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["affinity","anti-affinity"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + placementGroupTypePolicyPropEnum = append(placementGroupTypePolicyPropEnum, v) + } +} + +const ( + + // PlacementGroupPolicyAffinity captures enum value "affinity" + PlacementGroupPolicyAffinity string = "affinity" + + // PlacementGroupPolicyAntiAffinity captures enum value "anti-affinity" + PlacementGroupPolicyAntiAffinity string = "anti-affinity" +) + +// prop value enum +func (m *PlacementGroup) validatePolicyEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, placementGroupTypePolicyPropEnum); err != nil { + return err + } + return nil +} + +func (m *PlacementGroup) validatePolicy(formats strfmt.Registry) error { + + if err := validate.Required("policy", "body", m.Policy); err != nil { + return err + } + + // value enum + if err := m.validatePolicyEnum("policy", "body", *m.Policy); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PlacementGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlacementGroup) UnmarshalBinary(b []byte) error { + var res PlacementGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_create.go new file mode 100644 index 00000000000..64004b10314 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_create.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PlacementGroupCreate placement group create +// swagger:model PlacementGroupCreate +type PlacementGroupCreate struct { + + // The name of the Placement Group + // Required: true + Name *string `json:"name"` + + // The Placement Group Policy + // Required: true + // Enum: [affinity anti-affinity] + Policy *string `json:"policy"` +} + +// Validate validates this placement group create +func (m *PlacementGroupCreate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePolicy(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PlacementGroupCreate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +var placementGroupCreateTypePolicyPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["affinity","anti-affinity"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + placementGroupCreateTypePolicyPropEnum = append(placementGroupCreateTypePolicyPropEnum, v) + } +} + +const ( + + // PlacementGroupCreatePolicyAffinity captures enum value "affinity" + PlacementGroupCreatePolicyAffinity string = "affinity" + + // PlacementGroupCreatePolicyAntiAffinity captures enum value "anti-affinity" + PlacementGroupCreatePolicyAntiAffinity string = "anti-affinity" +) + +// prop value enum +func (m *PlacementGroupCreate) validatePolicyEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, placementGroupCreateTypePolicyPropEnum); err != nil { + return err + } + return nil +} + +func (m *PlacementGroupCreate) validatePolicy(formats strfmt.Registry) error { + + if err := validate.Required("policy", "body", m.Policy); err != nil { + return err + } + + // value enum + if err := m.validatePolicyEnum("policy", "body", *m.Policy); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PlacementGroupCreate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlacementGroupCreate) UnmarshalBinary(b []byte) error { + var res PlacementGroupCreate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_server.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_server.go new file mode 100644 index 00000000000..f1346950210 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_server.go @@ -0,0 +1,64 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PlacementGroupServer placement group server +// swagger:model PlacementGroupServer +type PlacementGroupServer struct { + + // The ID of the Server + // Required: true + ID *string `json:"id"` +} + +// Validate validates this placement group server +func (m *PlacementGroupServer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PlacementGroupServer) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PlacementGroupServer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlacementGroupServer) UnmarshalBinary(b []byte) error { + var res PlacementGroupServer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_groups.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_groups.go new file mode 100644 index 00000000000..0e6ec690c98 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_groups.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PlacementGroups placement groups +// swagger:model PlacementGroups +type PlacementGroups struct { + + // List of Server Placement Groups + // Required: true + PlacementGroups []*PlacementGroup `json:"placementGroups"` +} + +// Validate validates this placement groups +func (m *PlacementGroups) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePlacementGroups(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PlacementGroups) validatePlacementGroups(formats strfmt.Registry) error { + + if err := validate.Required("placementGroups", "body", m.PlacementGroups); err != nil { + return err + } + + for i := 0; i < len(m.PlacementGroups); i++ { + if swag.IsZero(m.PlacementGroups[i]) { // not required + continue + } + + if m.PlacementGroups[i] != nil { + if err := m.PlacementGroups[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("placementGroups" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PlacementGroups) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlacementGroups) UnmarshalBinary(b []byte) error { + var res PlacementGroups + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_create.go index f2d3af08112..c561a11a141 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_create.go @@ -44,6 +44,15 @@ type SAPCreate struct { // The name of the SSH Key to provide to the server for authenticating SSHKeyName string `json:"sshKeyName,omitempty"` + // The storage affinity data + StorageAffinity *StorageAffinity `json:"storageAffinity,omitempty"` + + // Storage Pool for server deployment; if provided then storageAffinityPolicy and storageType will be ignored + StoragePool string `json:"storagePool,omitempty"` + + // Storage type for server deployment; will be ignored if storagePool or storageAffinityPolicy is provided + StorageType string `json:"storageType,omitempty"` + // Cloud init user defined data UserData string `json:"userData,omitempty"` @@ -79,6 +88,10 @@ func (m *SAPCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateStorageAffinity(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -171,6 +184,24 @@ func (m *SAPCreate) validateProfileID(formats strfmt.Registry) error { return nil } +func (m *SAPCreate) validateStorageAffinity(formats strfmt.Registry) error { + + if swag.IsZero(m.StorageAffinity) { // not required + return nil + } + + if m.StorageAffinity != nil { + if err := m.StorageAffinity.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageAffinity") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *SAPCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/softlayer_subscription.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/softlayer_subscription.go new file mode 100644 index 00000000000..c47a1216d60 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/softlayer_subscription.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SoftlayerSubscription Softlayer subscription object +// swagger:model SoftlayerSubscription +type SoftlayerSubscription struct { + + // Softlayer ID + // Required: true + ID *string `json:"id"` + + // State of softlayer subscription + // Required: true + State *string `json:"state"` +} + +// Validate validates this softlayer subscription +func (m *SoftlayerSubscription) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SoftlayerSubscription) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *SoftlayerSubscription) validateState(formats strfmt.Registry) error { + + if err := validate.Required("state", "body", m.State); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SoftlayerSubscription) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SoftlayerSubscription) UnmarshalBinary(b []byte) error { + var res SoftlayerSubscription + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_affinity.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_affinity.go new file mode 100644 index 00000000000..b61a3be7380 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_affinity.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// StorageAffinity storage affinity +// swagger:model StorageAffinity +type StorageAffinity struct { + + // PVM Instance (ID or Name) to base storage affinity policy against; required if requesting storage affinity and storageAffinityVolume is not provided + AffinityPVMInstance *string `json:"affinityPVMInstance,omitempty"` + + // Affinity policy for storage pool selection where server will be deployed; ignored if storagePool provided; for policy affinity requires one of storageAffinityPVMInstance or storageAffinityVolume to be specified; for policy anti-affinity requires one of storageAntiAffinityPVMInstances or storageAntiAffinityVolumes to be specified + // Enum: [affinity anti-affinity] + AffinityPolicy *string `json:"affinityPolicy,omitempty"` + + // Volume (ID or Name) to base storage affinity policy against; required if requesting storage affinity and storageAffinityPVMInstance is not provided + AffinityVolume *string `json:"affinityVolume,omitempty"` + + // List of pvmInstances to base storage anti-affinity policy against; required if requesting storage anti-affinity and storageAntiAffinityVolumes is not provided + AntiAffinityPVMInstances []string `json:"antiAffinityPVMInstances"` + + // List of volumes to base storage anti-affinity policy against; required if requesting storage anti-affinity and storageAntiAffinityPVMInstances is not provided + AntiAffinityVolumes []string `json:"antiAffinityVolumes"` +} + +// Validate validates this storage affinity +func (m *StorageAffinity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAffinityPolicy(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var storageAffinityTypeAffinityPolicyPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["affinity","anti-affinity"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + storageAffinityTypeAffinityPolicyPropEnum = append(storageAffinityTypeAffinityPolicyPropEnum, v) + } +} + +const ( + + // StorageAffinityAffinityPolicyAffinity captures enum value "affinity" + StorageAffinityAffinityPolicyAffinity string = "affinity" + + // StorageAffinityAffinityPolicyAntiAffinity captures enum value "anti-affinity" + StorageAffinityAffinityPolicyAntiAffinity string = "anti-affinity" +) + +// prop value enum +func (m *StorageAffinity) validateAffinityPolicyEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, storageAffinityTypeAffinityPolicyPropEnum); err != nil { + return err + } + return nil +} + +func (m *StorageAffinity) validateAffinityPolicy(formats strfmt.Registry) error { + + if swag.IsZero(m.AffinityPolicy) { // not required + return nil + } + + // value enum + if err := m.validateAffinityPolicyEnum("affinityPolicy", "body", *m.AffinityPolicy); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *StorageAffinity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StorageAffinity) UnmarshalBinary(b []byte) error { + var res StorageAffinity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume.go index cd842d71edc..a813b1fffde 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume.go @@ -60,6 +60,9 @@ type Volume struct { // Required: true VolumeID *string `json:"volumeID"` + // Volume pool, name of storage pool where the volume is located + VolumePool string `json:"volumePool,omitempty"` + // Volume type, name of storage template used to create the volume VolumeType string `json:"volumeType,omitempty"` diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_reference.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_reference.go index ae20e65e375..33228a49dce 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_reference.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_reference.go @@ -68,6 +68,9 @@ type VolumeReference struct { // Required: true VolumeID *string `json:"volumeID"` + // Volume pool, name of storage pool where the volume is located + VolumePool string `json:"volumePool,omitempty"` + // Volume type, name of storage template used to create the volume VolumeType string `json:"volumeType,omitempty"` diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attach.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attach.go new file mode 100644 index 00000000000..1c8c8a3eda2 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attach.go @@ -0,0 +1,64 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VolumesAttach volumes attach +// swagger:model volumesAttach +type VolumesAttach struct { + + // List of volumes to be attached to a PVM instance + // Required: true + VolumeIds []string `json:"volumeIDs"` +} + +// Validate validates this volumes attach +func (m *VolumesAttach) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateVolumeIds(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VolumesAttach) validateVolumeIds(formats strfmt.Registry) error { + + if err := validate.Required("volumeIDs", "body", m.VolumeIds); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VolumesAttach) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VolumesAttach) UnmarshalBinary(b []byte) error { + var res VolumesAttach + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attachment_response.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attachment_response.go new file mode 100644 index 00000000000..985fe4c5867 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attachment_response.go @@ -0,0 +1,64 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VolumesAttachmentResponse volumes attachment response +// swagger:model VolumesAttachmentResponse +type VolumesAttachmentResponse struct { + + // status summary for volume attachment to a PVM Instance + // Required: true + Summary *string `json:"summary"` +} + +// Validate validates this volumes attachment response +func (m *VolumesAttachmentResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSummary(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VolumesAttachmentResponse) validateSummary(formats strfmt.Registry) error { + + if err := validate.Required("summary", "body", m.Summary); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VolumesAttachmentResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VolumesAttachmentResponse) UnmarshalBinary(b []byte) error { + var res VolumesAttachmentResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_async_request.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_async_request.go index 6174a967e26..d6feeecaaa8 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_async_request.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_async_request.go @@ -19,11 +19,11 @@ type VolumesCloneAsyncRequest struct { // Base name of the new cloned volume(s). // Cloned Volume names will be prefixed with 'clone-' - // and suffixed with ‘-#####’ (where ##### is a 5 digit random number) + // and suffixed with '-#####' (where ##### is a 5 digit random number) // If multiple volumes cloned they will be further suffixed with an incremental number starting with 1. // Example volume names using name="volume-abcdef" - // single volume clone will be named "clone-volume-abcdef-83081“ - // multi volume clone will be named "clone-volume-abcdef-73721-1”, "clone-volume-abcdef-73721-2”, ... + // single volume clone will be named "clone-volume-abcdef-83081" + // multi volume clone will be named "clone-volume-abcdef-73721-1", "clone-volume-abcdef-73721-2", ... // // Required: true Name *string `json:"name"` diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_cancel.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_cancel.go index 7922a1605c9..b7247a0702a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_cancel.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_cancel.go @@ -15,7 +15,7 @@ import ( // swagger:model VolumesCloneCancel type VolumesCloneCancel struct { - // default False, Cancel will only be allowed if the status is ‘prepared’, or ‘available’ + // default False, Cancel will only be allowed if the status is 'prepared', or 'available' // True, Cancel will be allowed when the status is NOT completed, cancelling, cancelled, or failed // Force bool `json:"force,omitempty"` diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_execute.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_execute.go index 14d9102b919..ff610c70572 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_execute.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_execute.go @@ -19,11 +19,11 @@ type VolumesCloneExecute struct { // Base name of the new cloned volume(s). // Cloned Volume names will be prefixed with 'clone-' - // and suffixed with ‘-#####’ (where ##### is a 5 digit random number) + // and suffixed with '-#####' (where ##### is a 5 digit random number) // If multiple volumes cloned they will be further suffixed with an incremental number starting with 1. // Example volume names using name="volume-abcdef" - // single volume clone will be named "clone-volume-abcdef-83081“ - // multi volume clone will be named "clone-volume-abcdef-73721-1”, "clone-volume-abcdef-73721-2”, ... + // single volume clone will be named "clone-volume-abcdef-83081" + // multi volume clone will be named "clone-volume-abcdef-73721-1", "clone-volume-abcdef-73721-2", ... // // Required: true Name *string `json:"name"` diff --git a/vendor/github.com/openshift/cluster-api-provider-powervs/LICENSE b/vendor/github.com/openshift/cluster-api-provider-powervs/LICENSE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api-provider-powervs/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + 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. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) 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 + + (d) 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. + + 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. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/groupversion_info.go b/vendor/github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/groupversion_info.go new file mode 100644 index 00000000000..6feea851175 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/groupversion_info.go @@ -0,0 +1,106 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1alpha1 contains API Schema definitions for the powervsproviderconfig v1alpha1 API group +//+kubebuilder:object:generate=true +//+groupName=powervsproviderconfig.openshift.io +package v1alpha1 + +import ( + "encoding/json" + "fmt" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/klog/v2" + "sigs.k8s.io/controller-runtime/pkg/scheme" + "sigs.k8s.io/yaml" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "powervsproviderconfig.openshift.io", Version: "v1alpha1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) + +// RawExtensionFromProviderSpec marshals the machine provider spec. +func RawExtensionFromProviderSpec(spec *PowerVSMachineProviderConfig) (*runtime.RawExtension, error) { + if spec == nil { + return &runtime.RawExtension{}, nil + } + + var rawBytes []byte + var err error + if rawBytes, err = json.Marshal(spec); err != nil { + return nil, fmt.Errorf("error marshalling providerSpec: %v", err) + } + + return &runtime.RawExtension{ + Raw: rawBytes, + }, nil +} + +// RawExtensionFromProviderStatus marshals the machine provider status +func RawExtensionFromProviderStatus(status *PowerVSMachineProviderStatus) (*runtime.RawExtension, error) { + if status == nil { + return &runtime.RawExtension{}, nil + } + + var rawBytes []byte + var err error + if rawBytes, err = json.Marshal(status); err != nil { + return nil, fmt.Errorf("error marshalling providerStatus: %v", err) + } + + return &runtime.RawExtension{ + Raw: rawBytes, + }, nil +} + +// ProviderSpecFromRawExtension unmarshals a raw extension into an PowerVSMachineProviderConfig type +func ProviderSpecFromRawExtension(rawExtension *runtime.RawExtension) (*PowerVSMachineProviderConfig, error) { + if rawExtension == nil { + return &PowerVSMachineProviderConfig{}, nil + } + + spec := new(PowerVSMachineProviderConfig) + if err := yaml.Unmarshal(rawExtension.Raw, &spec); err != nil { + return nil, fmt.Errorf("error unmarshalling providerSpec: %v", err) + } + + klog.V(5).Infof("Got provider Spec from raw extension: %+v", spec) + return spec, nil +} + +// ProviderStatusFromRawExtension unmarshals a raw extension into an PowerVSMachineProviderStatus type +func ProviderStatusFromRawExtension(rawExtension *runtime.RawExtension) (*PowerVSMachineProviderStatus, error) { + if rawExtension == nil { + return &PowerVSMachineProviderStatus{}, nil + } + + providerStatus := new(PowerVSMachineProviderStatus) + if err := yaml.Unmarshal(rawExtension.Raw, providerStatus); err != nil { + return nil, fmt.Errorf("error unmarshalling providerStatus: %v", err) + } + + klog.V(5).Infof("Got provider Status from raw extension: %+v", providerStatus) + return providerStatus, nil +} diff --git a/vendor/github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/powervsmachineproviderconfig_types.go b/vendor/github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/powervsmachineproviderconfig_types.go new file mode 100644 index 00000000000..66597780fa3 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/powervsmachineproviderconfig_types.go @@ -0,0 +1,90 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status + +// PowerVSMachineProviderConfig is the Schema for the powervsmachineproviderconfigs API +type PowerVSMachineProviderConfig struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // ServiceInstanceID is the PowerVS service ID + ServiceInstanceID string `json:"serviceInstanceID"` + + // Image is the reference to the Image from which to create the machine instance. + Image PowerVSResourceReference `json:"image"` + + // UserDataSecret is the k8s secret contains the user data script + UserDataSecret *corev1.LocalObjectReference `json:"userDataSecret,omitempty"` + + // CredentialsSecret is the k8s secret contains the API Key for IBM Cloud authentication + CredentialsSecret *corev1.LocalObjectReference `json:"credentialsSecret,omitempty"` + + // SysType is the System type used to host the vsi + SysType string `json:"sysType"` + + // ProcessorType is the processor type, e.g: dedicated, shared, capped + ProcType string `json:"procType"` + + // Processors is Number of processors allocated + Processors string `json:"processors"` + + // Memory is Amount of memory allocated (in GB) + Memory string `json:"memory"` + + // Network is the reference to the Network to use for this instance. + Network PowerVSResourceReference `json:"network"` + + // KeyPairName is the name of the SSH key pair provided to the server for authenticating users + KeyPairName string `json:"keyPairName,omitempty"` +} + +// PowerVSResourceReference is a reference to a specific PowerVS resource by ID or Name +// Only one of ID or Name may be specified. Specifying more than one will result in +// a validation error. +type PowerVSResourceReference struct { + // ID of resource + // +optional + ID *string `json:"id,omitempty"` + + // Name of resource + // +optional + Name *string `json:"name,omitempty"` +} + +//+kubebuilder:object:root=true + +// PowerVSMachineProviderConfigList contains a list of PowerVSMachineProviderConfig +type PowerVSMachineProviderConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []PowerVSMachineProviderConfig `json:"items"` +} + +func init() { + SchemeBuilder.Register(&PowerVSMachineProviderConfig{}, &PowerVSMachineProviderConfigList{}, &PowerVSMachineProviderStatus{}) +} diff --git a/vendor/github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/powervsmachineproviderstatus_types.go b/vendor/github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/powervsmachineproviderstatus_types.go new file mode 100644 index 00000000000..cf7a1a5cb39 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/powervsmachineproviderstatus_types.go @@ -0,0 +1,81 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// PowerVSMachineProviderStatus is the type that will be embedded in a Machine.Status.ProviderStatus field. +// It contains PowerVS-specific status information. +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type PowerVSMachineProviderStatus struct { + metav1.TypeMeta `json:",inline"` + + // InstanceID is the instance ID of the machine created in PowerVS + // +optional + InstanceID *string `json:"instanceId,omitempty"` + + // InstanceState is the state of the PowerVS instance for this machine + // +optional + InstanceState *string `json:"instanceState,omitempty"` + + // Conditions is a set of conditions associated with the Machine to indicate + // errors or other status + Conditions []PowerVSMachineProviderCondition `json:"conditions,omitempty"` +} + +// PowerVSMachineProviderConditionType is a valid value for PowerVSMachineProviderCondition.Type +type PowerVSMachineProviderConditionType string + +// Valid conditions for an PowerVS machine instance. +const ( + // MachineCreation indicates whether the machine has been created or not. If not, + // it should include a reason and message for the failure. + MachineCreation PowerVSMachineProviderConditionType = "MachineCreation" +) + +// PowerVSMachineProviderConditionReason is reason for the condition's last transition. +type PowerVSMachineProviderConditionReason string + +const ( + // MachineCreationSucceeded indicates machine creation success. + MachineCreationSucceeded PowerVSMachineProviderConditionReason = "MachineCreationSucceeded" + // MachineCreationFailed indicates machine creation failure. + MachineCreationFailed PowerVSMachineProviderConditionReason = "MachineCreationFailed" +) + +// PowerVSMachineProviderCondition is a condition in a PowerVSMachineProviderStatus. +type PowerVSMachineProviderCondition struct { + // Type is the type of the condition. + Type PowerVSMachineProviderConditionType `json:"type"` + // Status is the status of the condition. + Status corev1.ConditionStatus `json:"status"` + // LastProbeTime is the last time we probed the condition. + // +optional + LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` + // LastTransitionTime is the last time the condition transitioned from one status to another. + // +optional + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + // Reason is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional + Reason PowerVSMachineProviderConditionReason `json:"reason,omitempty"` + // Message is a human-readable message indicating details about last transition. + // +optional + Message string `json:"message,omitempty"` +} diff --git a/vendor/github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 00000000000..c78e4a58557 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,178 @@ +// +build !ignore_autogenerated + +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PowerVSMachineProviderCondition) DeepCopyInto(out *PowerVSMachineProviderCondition) { + *out = *in + in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PowerVSMachineProviderCondition. +func (in *PowerVSMachineProviderCondition) DeepCopy() *PowerVSMachineProviderCondition { + if in == nil { + return nil + } + out := new(PowerVSMachineProviderCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PowerVSMachineProviderConfig) DeepCopyInto(out *PowerVSMachineProviderConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Image.DeepCopyInto(&out.Image) + if in.UserDataSecret != nil { + in, out := &in.UserDataSecret, &out.UserDataSecret + *out = new(v1.LocalObjectReference) + **out = **in + } + if in.CredentialsSecret != nil { + in, out := &in.CredentialsSecret, &out.CredentialsSecret + *out = new(v1.LocalObjectReference) + **out = **in + } + in.Network.DeepCopyInto(&out.Network) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PowerVSMachineProviderConfig. +func (in *PowerVSMachineProviderConfig) DeepCopy() *PowerVSMachineProviderConfig { + if in == nil { + return nil + } + out := new(PowerVSMachineProviderConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PowerVSMachineProviderConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PowerVSMachineProviderConfigList) DeepCopyInto(out *PowerVSMachineProviderConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PowerVSMachineProviderConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PowerVSMachineProviderConfigList. +func (in *PowerVSMachineProviderConfigList) DeepCopy() *PowerVSMachineProviderConfigList { + if in == nil { + return nil + } + out := new(PowerVSMachineProviderConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PowerVSMachineProviderConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PowerVSMachineProviderStatus) DeepCopyInto(out *PowerVSMachineProviderStatus) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.InstanceID != nil { + in, out := &in.InstanceID, &out.InstanceID + *out = new(string) + **out = **in + } + if in.InstanceState != nil { + in, out := &in.InstanceState, &out.InstanceState + *out = new(string) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]PowerVSMachineProviderCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PowerVSMachineProviderStatus. +func (in *PowerVSMachineProviderStatus) DeepCopy() *PowerVSMachineProviderStatus { + if in == nil { + return nil + } + out := new(PowerVSMachineProviderStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PowerVSMachineProviderStatus) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PowerVSResourceReference) DeepCopyInto(out *PowerVSResourceReference) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PowerVSResourceReference. +func (in *PowerVSResourceReference) DeepCopy() *PowerVSResourceReference { + if in == nil { + return nil + } + out := new(PowerVSResourceReference) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 45fcca17bdc..d7b3eb35bcb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -236,8 +236,9 @@ github.com/IBM-Cloud/bluemix-go/rest github.com/IBM-Cloud/bluemix-go/session github.com/IBM-Cloud/bluemix-go/trace github.com/IBM-Cloud/bluemix-go/utils -# github.com/IBM-Cloud/power-go-client v1.0.55 +# github.com/IBM-Cloud/power-go-client v1.0.72 github.com/IBM-Cloud/power-go-client/clients/instance +github.com/IBM-Cloud/power-go-client/errors github.com/IBM-Cloud/power-go-client/helpers github.com/IBM-Cloud/power-go-client/ibmpisession github.com/IBM-Cloud/power-go-client/power/client @@ -253,6 +254,7 @@ github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances +github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity @@ -1412,6 +1414,9 @@ github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig ## explicit github.com/openshift/cluster-api-provider-ovirt/pkg/apis github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1 +# github.com/openshift/cluster-api-provider-powervs v0.0.2-0.20210928133618-8eb5ebcb07a1 +## explicit +github.com/openshift/cluster-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1 # github.com/openshift/library-go v0.0.0-20210408164723-7a65fdb398e2 ## explicit github.com/openshift/library-go/pkg/config/clusteroperator/v1helpers