From b17ee8517e7ab41a1f652cbffafc62fa7a1a5acd Mon Sep 17 00:00:00 2001 From: Joachim Hill-Grannec Date: Thu, 2 Aug 2018 22:29:39 +0200 Subject: [PATCH] mode to dep --- .drone.yml | 7 + .github/issue_template.md | 5 + .github/pull_request_template.md | 6 + .gitignore | 1 + Gopkg.lock | 72 + Gopkg.toml | 42 + .../github.com/Sirupsen/logrus/CHANGELOG.md | 66 - vendor/github.com/Sirupsen/logrus/LICENSE | 21 - vendor/github.com/Sirupsen/logrus/README.md | 388 ----- vendor/github.com/Sirupsen/logrus/doc.go | 26 - vendor/github.com/Sirupsen/logrus/entry.go | 264 ---- vendor/github.com/Sirupsen/logrus/exported.go | 193 --- .../github.com/Sirupsen/logrus/formatter.go | 48 - vendor/github.com/Sirupsen/logrus/hooks.go | 34 - .../Sirupsen/logrus/json_formatter.go | 41 - vendor/github.com/Sirupsen/logrus/logger.go | 212 --- vendor/github.com/Sirupsen/logrus/logrus.go | 143 -- .../Sirupsen/logrus/terminal_bsd.go | 9 - .../Sirupsen/logrus/terminal_linux.go | 12 - .../Sirupsen/logrus/terminal_notwindows.go | 21 - .../Sirupsen/logrus/terminal_solaris.go | 15 - .../Sirupsen/logrus/terminal_windows.go | 27 - .../Sirupsen/logrus/text_formatter.go | 161 -- vendor/github.com/Sirupsen/logrus/writer.go | 31 - vendor/github.com/gorilla/websocket/AUTHORS | 8 - vendor/github.com/gorilla/websocket/LICENSE | 22 - vendor/github.com/gorilla/websocket/README.md | 64 - vendor/github.com/gorilla/websocket/client.go | 392 ----- .../gorilla/websocket/client_clone.go | 16 - .../gorilla/websocket/client_clone_legacy.go | 38 - .../gorilla/websocket/compression.go | 148 -- vendor/github.com/gorilla/websocket/conn.go | 1149 -------------- .../github.com/gorilla/websocket/conn_read.go | 18 - .../gorilla/websocket/conn_read_legacy.go | 21 - vendor/github.com/gorilla/websocket/doc.go | 179 --- vendor/github.com/gorilla/websocket/json.go | 60 - vendor/github.com/gorilla/websocket/mask.go | 55 - .../github.com/gorilla/websocket/mask_safe.go | 15 - .../github.com/gorilla/websocket/prepared.go | 103 -- vendor/github.com/gorilla/websocket/server.go | 292 ---- vendor/github.com/gorilla/websocket/util.go | 214 --- vendor/github.com/pkg/errors/LICENSE | 23 - vendor/github.com/pkg/errors/README.md | 52 - vendor/github.com/pkg/errors/appveyor.yml | 32 - vendor/github.com/pkg/errors/errors.go | 269 ---- vendor/github.com/pkg/errors/stack.go | 186 --- vendor/github.com/rancher/go-rancher/LICENSE | 177 --- .../rancher/go-rancher/v2/client.go | 39 - .../rancher/go-rancher/v2/common.go | 620 -------- .../go-rancher/v2/generated_account.go | 186 --- .../go-rancher/v2/generated_active_setting.go | 87 -- .../v2/generated_add_outputs_input.go | 79 - ...generated_add_remove_service_link_input.go | 79 - .../rancher/go-rancher/v2/generated_agent.go | 206 --- .../v2/generated_amazonec2config.go | 137 -- .../go-rancher/v2/generated_api_key.go | 173 --- .../go-rancher/v2/generated_audit_log.go | 105 -- .../go-rancher/v2/generated_azure_config.go | 121 -- .../go-rancher/v2/generated_azureadconfig.go | 93 -- .../rancher/go-rancher/v2/generated_backup.go | 133 -- .../go-rancher/v2/generated_backup_target.go | 127 -- .../v2/generated_base_machine_config.go | 77 - .../go-rancher/v2/generated_binding.go | 79 - .../v2/generated_blkio_device_option.go | 87 -- .../v2/generated_catalog_template.go | 93 -- .../go-rancher/v2/generated_certificate.go | 162 -- .../v2/generated_change_secret_input.go | 81 - .../rancher/go-rancher/v2/generated_client.go | 353 ----- .../v2/generated_cluster_membership.go | 87 -- .../go-rancher/v2/generated_compose_config.go | 81 - .../v2/generated_compose_config_input.go | 79 - .../v2/generated_compose_project.go | 191 --- .../v2/generated_compose_service.go | 212 --- .../go-rancher/v2/generated_config_item.go | 81 - .../v2/generated_config_item_status.go | 93 -- .../go-rancher/v2/generated_container.go | 517 ------ .../v2/generated_container_event.go | 129 -- .../go-rancher/v2/generated_container_exec.go | 85 - .../go-rancher/v2/generated_container_logs.go | 81 - .../v2/generated_container_proxy.go | 81 - .../go-rancher/v2/generated_credential.go | 173 --- .../v2/generated_databasechangelog.go | 97 -- .../v2/generated_databasechangeloglock.go | 83 - .../v2/generated_default_network.go | 183 --- .../v2/generated_digitalocean_config.go | 101 -- .../go-rancher/v2/generated_dns_service.go | 285 ---- .../go-rancher/v2/generated_docker_build.go | 89 -- .../v2/generated_extension_implementation.go | 83 - .../v2/generated_extension_point.go | 87 -- .../v2/generated_external_dns_event.go | 129 -- .../go-rancher/v2/generated_external_event.go | 123 -- .../v2/generated_external_handler.go | 175 --- ...al_handler_external_handler_process_map.go | 175 --- .../v2/generated_external_handler_process.go | 167 -- ...nerated_external_handler_process_config.go | 81 - .../v2/generated_external_host_event.go | 129 -- .../v2/generated_external_service.go | 252 --- .../v2/generated_external_service_event.go | 127 -- .../generated_external_storage_pool_event.go | 127 -- .../v2/generated_external_volume_event.go | 125 -- .../v2/generated_field_documentation.go | 79 - .../go-rancher/v2/generated_generic_object.go | 129 -- .../go-rancher/v2/generated_ha_config.go | 85 - .../v2/generated_ha_config_input.go | 109 -- ...generated_healthcheck_instance_host_map.go | 131 -- .../rancher/go-rancher/v2/generated_host.go | 275 ---- .../go-rancher/v2/generated_host_access.go | 81 - .../v2/generated_host_api_proxy_token.go | 83 - .../go-rancher/v2/generated_host_template.go | 133 -- .../go-rancher/v2/generated_identity.go | 97 -- .../rancher/go-rancher/v2/generated_image.go | 169 -- .../generated_in_service_upgrade_strategy.go | 91 -- .../go-rancher/v2/generated_instance.go | 272 ---- .../v2/generated_instance_console.go | 83 - .../v2/generated_instance_console_input.go | 77 - .../v2/generated_instance_health_check.go | 99 -- .../go-rancher/v2/generated_instance_link.go | 177 --- .../go-rancher/v2/generated_instance_stop.go | 81 - .../go-rancher/v2/generated_ip_address.go | 195 --- .../v2/generated_kubernetes_service.go | 275 ---- .../v2/generated_kubernetes_stack.go | 204 --- .../v2/generated_kubernetes_stack_upgrade.go | 85 - .../rancher/go-rancher/v2/generated_label.go | 129 -- .../go-rancher/v2/generated_launch_config.go | 518 ------- .../go-rancher/v2/generated_lb_config.go | 87 -- .../v2/generated_lb_target_config.go | 79 - ..._load_balancer_cookie_stickiness_policy.go | 91 -- .../v2/generated_load_balancer_service.go | 297 ---- .../v2/generated_local_auth_config.go | 87 -- .../go-rancher/v2/generated_log_config.go | 81 - .../go-rancher/v2/generated_machine.go | 194 --- .../go-rancher/v2/generated_machine_driver.go | 192 --- .../rancher/go-rancher/v2/generated_mount.go | 144 -- .../go-rancher/v2/generated_mount_entry.go | 87 -- .../go-rancher/v2/generated_network.go | 185 --- .../go-rancher/v2/generated_network_driver.go | 166 -- .../v2/generated_network_driver_service.go | 305 ---- .../v2/generated_network_policy_rule.go | 89 -- .../generated_network_policy_rule_between.go | 81 - .../generated_network_policy_rule_member.go | 79 - .../generated_network_policy_rule_within.go | 77 - .../go-rancher/v2/generated_nfs_config.go | 83 - .../go-rancher/v2/generated_openldapconfig.go | 129 -- .../go-rancher/v2/generated_packet_config.go | 89 -- .../go-rancher/v2/generated_password.go | 184 --- .../go-rancher/v2/generated_physical_host.go | 162 -- .../rancher/go-rancher/v2/generated_port.go | 183 --- .../go-rancher/v2/generated_port_rule.go | 95 -- .../v2/generated_process_definition.go | 91 -- .../v2/generated_process_execution.go | 85 - .../v2/generated_process_instance.go | 118 -- .../go-rancher/v2/generated_process_pool.go | 95 -- .../v2/generated_process_summary.go | 85 - .../go-rancher/v2/generated_project.go | 211 --- .../go-rancher/v2/generated_project_member.go | 175 --- .../v2/generated_project_template.go | 131 -- .../v2/generated_public_endpoint.go | 87 -- .../go-rancher/v2/generated_publish.go | 99 -- .../go-rancher/v2/generated_pull_task.go | 133 -- ...ated_recreate_on_quorum_strategy_config.go | 79 - .../go-rancher/v2/generated_register.go | 144 -- .../v2/generated_registration_token.go | 177 --- .../go-rancher/v2/generated_registry.go | 181 --- .../v2/generated_registry_credential.go | 175 --- .../v2/generated_resource_definition.go | 79 - .../go-rancher/v2/generated_restart_policy.go | 81 - .../v2/generated_restore_from_backup_input.go | 79 - .../v2/generated_revert_to_snapshot_input.go | 79 - .../v2/generated_rolling_restart_strategy.go | 81 - .../go-rancher/v2/generated_scale_policy.go | 83 - .../v2/generated_scheduled_upgrade.go | 136 -- .../v2/generated_secondary_launch_config.go | 520 ------- .../rancher/go-rancher/v2/generated_secret.go | 127 -- .../v2/generated_secret_reference.go | 87 -- .../go-rancher/v2/generated_service.go | 303 ---- .../v2/generated_service_binding.go | 81 - .../v2/generated_service_consume_map.go | 142 -- .../go-rancher/v2/generated_service_event.go | 135 -- .../v2/generated_service_expose_map.go | 133 -- .../go-rancher/v2/generated_service_link.go | 83 - .../go-rancher/v2/generated_service_log.go | 101 -- .../go-rancher/v2/generated_service_proxy.go | 87 -- .../v2/generated_service_restart.go | 79 - .../v2/generated_service_upgrade.go | 81 - .../v2/generated_service_upgrade_strategy.go | 81 - .../v2/generated_services_port_range.go | 81 - .../v2/generated_set_project_members_input.go | 79 - .../v2/generated_set_service_links_input.go | 79 - .../go-rancher/v2/generated_setting.go | 87 -- .../go-rancher/v2/generated_snapshot.go | 138 -- .../v2/generated_snapshot_backup_input.go | 107 -- .../rancher/go-rancher/v2/generated_stack.go | 265 ---- .../go-rancher/v2/generated_stack_upgrade.go | 89 -- .../v2/generated_state_transition.go | 77 - .../go-rancher/v2/generated_stats_access.go | 81 - .../go-rancher/v2/generated_storage_driver.go | 168 -- .../v2/generated_storage_driver_service.go | 305 ---- .../go-rancher/v2/generated_storage_pool.go | 185 --- .../rancher/go-rancher/v2/generated_subnet.go | 181 --- .../v2/generated_target_port_rule.go | 85 - .../rancher/go-rancher/v2/generated_task.go | 90 -- .../go-rancher/v2/generated_task_instance.go | 89 -- .../generated_to_service_upgrade_strategy.go | 87 -- .../v2/generated_type_documentation.go | 81 - .../rancher/go-rancher/v2/generated_ulimit.go | 83 - .../v2/generated_user_preference.go | 173 --- .../v2/generated_virtual_machine.go | 485 ------ .../v2/generated_virtual_machine_disk.go | 91 -- .../rancher/go-rancher/v2/generated_volume.go | 230 --- .../v2/generated_volume_activate_input.go | 79 - .../v2/generated_volume_snapshot_input.go | 79 - .../v2/generated_volume_template.go | 179 --- .../rancher/go-rancher/v2/schemas.go | 131 -- .../github.com/rancher/go-rancher/v2/types.go | 95 -- vendor/github.com/urfave/cli/CHANGELOG.md | 392 ----- vendor/github.com/urfave/cli/LICENSE | 21 - vendor/github.com/urfave/cli/README.md | 1381 ----------------- vendor/github.com/urfave/cli/app.go | 497 ------ vendor/github.com/urfave/cli/appveyor.yml | 24 - vendor/github.com/urfave/cli/category.go | 44 - vendor/github.com/urfave/cli/cli.go | 22 - vendor/github.com/urfave/cli/command.go | 304 ---- vendor/github.com/urfave/cli/context.go | 278 ---- vendor/github.com/urfave/cli/errors.go | 115 -- vendor/github.com/urfave/cli/flag-types.json | 93 -- vendor/github.com/urfave/cli/flag.go | 799 ---------- .../github.com/urfave/cli/flag_generated.go | 627 -------- vendor/github.com/urfave/cli/funcs.go | 28 - .../github.com/urfave/cli/generate-flag-types | 255 --- vendor/github.com/urfave/cli/help.go | 338 ---- vendor/github.com/urfave/cli/runtests | 122 -- vendor/vendor.json | 37 - 232 files changed, 133 insertions(+), 33853 deletions(-) create mode 100644 .github/issue_template.md create mode 100644 .github/pull_request_template.md create mode 100644 Gopkg.lock create mode 100644 Gopkg.toml delete mode 100755 vendor/github.com/Sirupsen/logrus/CHANGELOG.md delete mode 100755 vendor/github.com/Sirupsen/logrus/LICENSE delete mode 100755 vendor/github.com/Sirupsen/logrus/README.md delete mode 100755 vendor/github.com/Sirupsen/logrus/doc.go delete mode 100755 vendor/github.com/Sirupsen/logrus/entry.go delete mode 100755 vendor/github.com/Sirupsen/logrus/exported.go delete mode 100755 vendor/github.com/Sirupsen/logrus/formatter.go delete mode 100755 vendor/github.com/Sirupsen/logrus/hooks.go delete mode 100755 vendor/github.com/Sirupsen/logrus/json_formatter.go delete mode 100755 vendor/github.com/Sirupsen/logrus/logger.go delete mode 100755 vendor/github.com/Sirupsen/logrus/logrus.go delete mode 100755 vendor/github.com/Sirupsen/logrus/terminal_bsd.go delete mode 100755 vendor/github.com/Sirupsen/logrus/terminal_linux.go delete mode 100755 vendor/github.com/Sirupsen/logrus/terminal_notwindows.go delete mode 100755 vendor/github.com/Sirupsen/logrus/terminal_solaris.go delete mode 100755 vendor/github.com/Sirupsen/logrus/terminal_windows.go delete mode 100755 vendor/github.com/Sirupsen/logrus/text_formatter.go delete mode 100755 vendor/github.com/Sirupsen/logrus/writer.go delete mode 100644 vendor/github.com/gorilla/websocket/AUTHORS delete mode 100644 vendor/github.com/gorilla/websocket/LICENSE delete mode 100644 vendor/github.com/gorilla/websocket/README.md delete mode 100644 vendor/github.com/gorilla/websocket/client.go delete mode 100644 vendor/github.com/gorilla/websocket/client_clone.go delete mode 100644 vendor/github.com/gorilla/websocket/client_clone_legacy.go delete mode 100644 vendor/github.com/gorilla/websocket/compression.go delete mode 100644 vendor/github.com/gorilla/websocket/conn.go delete mode 100644 vendor/github.com/gorilla/websocket/conn_read.go delete mode 100644 vendor/github.com/gorilla/websocket/conn_read_legacy.go delete mode 100644 vendor/github.com/gorilla/websocket/doc.go delete mode 100644 vendor/github.com/gorilla/websocket/json.go delete mode 100644 vendor/github.com/gorilla/websocket/mask.go delete mode 100644 vendor/github.com/gorilla/websocket/mask_safe.go delete mode 100644 vendor/github.com/gorilla/websocket/prepared.go delete mode 100644 vendor/github.com/gorilla/websocket/server.go delete mode 100644 vendor/github.com/gorilla/websocket/util.go delete mode 100644 vendor/github.com/pkg/errors/LICENSE delete mode 100644 vendor/github.com/pkg/errors/README.md delete mode 100644 vendor/github.com/pkg/errors/appveyor.yml delete mode 100644 vendor/github.com/pkg/errors/errors.go delete mode 100644 vendor/github.com/pkg/errors/stack.go delete mode 100644 vendor/github.com/rancher/go-rancher/LICENSE delete mode 100644 vendor/github.com/rancher/go-rancher/v2/client.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/common.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_account.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_agent.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_api_key.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_backup.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_binding.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_certificate.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_client.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_config_item.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_container.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_container_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_credential.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_default_network.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_host.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_host_access.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_host_template.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_identity.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_image.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_instance.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_label.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_log_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_machine.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_mount.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_between.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_member.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_within.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_password.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_port.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_process_pool.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_process_summary.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_project.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_project_member.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_project_template.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_publish.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_register.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_registry.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_scheduled_upgrade.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_secret.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_secret_reference.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_link.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_log.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_setting.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_stack.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_subnet.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_task.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_user_preference.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_volume.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/schemas.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/types.go delete mode 100644 vendor/github.com/urfave/cli/CHANGELOG.md delete mode 100644 vendor/github.com/urfave/cli/LICENSE delete mode 100644 vendor/github.com/urfave/cli/README.md delete mode 100644 vendor/github.com/urfave/cli/app.go delete mode 100644 vendor/github.com/urfave/cli/appveyor.yml delete mode 100644 vendor/github.com/urfave/cli/category.go delete mode 100644 vendor/github.com/urfave/cli/cli.go delete mode 100644 vendor/github.com/urfave/cli/command.go delete mode 100644 vendor/github.com/urfave/cli/context.go delete mode 100644 vendor/github.com/urfave/cli/errors.go delete mode 100644 vendor/github.com/urfave/cli/flag-types.json delete mode 100644 vendor/github.com/urfave/cli/flag.go delete mode 100644 vendor/github.com/urfave/cli/flag_generated.go delete mode 100644 vendor/github.com/urfave/cli/funcs.go delete mode 100755 vendor/github.com/urfave/cli/generate-flag-types delete mode 100644 vendor/github.com/urfave/cli/help.go delete mode 100755 vendor/github.com/urfave/cli/runtests delete mode 100644 vendor/vendor.json diff --git a/.drone.yml b/.drone.yml index 13c5300..6ab5db4 100755 --- a/.drone.yml +++ b/.drone.yml @@ -2,6 +2,13 @@ workspace: base: /go path: src/github.com/josmo/drone-rancher pipeline: + deps: + image: golang:1.10 + pull: true + commands: + - go get -u github.com/golang/dep/cmd/dep + - dep ensure + test: image: golang:1.9 commands: diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 0000000..9235ebf --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,5 @@ + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..0b2727e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,6 @@ + diff --git a/.gitignore b/.gitignore index d237d26..617578b 100755 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ coverage.out drone-rancher *.idea +vendor diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 0000000..71fb6fe --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,72 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + digest = "1:d867dfa6751c8d7a435821ad3b736310c2ed68945d05b50fb9d23aee0540c8cc" + name = "github.com/Sirupsen/logrus" + packages = ["."] + pruneopts = "UT" + revision = "3e01752db0189b9157070a0e1668a620f9a85da2" + version = "v1.0.6" + +[[projects]] + digest = "1:43dd08a10854b2056e615d1b1d22ac94559d822e1f8b6fcc92c1a1057e85188e" + name = "github.com/gorilla/websocket" + packages = ["."] + pruneopts = "UT" + revision = "ea4d1f681babbce9545c9c5f3d5194a789c89f5b" + version = "v1.2.0" + +[[projects]] + digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747" + name = "github.com/pkg/errors" + packages = ["."] + pruneopts = "UT" + revision = "645ef00459ed84a119197bfb8d8205042c6df63d" + version = "v0.8.0" + +[[projects]] + branch = "master" + digest = "1:0451d67c615c56d31c3689dd1c9aefa9d18c03f241199a0e3c470451666a1ab8" + name = "github.com/rancher/go-rancher" + packages = ["v2"] + pruneopts = "UT" + revision = "5d4e55e3f5de872bd5136d538139fffad238ad3a" + +[[projects]] + digest = "1:b24d38b282bacf9791408a080f606370efa3d364e4b5fd9ba0f7b87786d3b679" + name = "github.com/urfave/cli" + packages = ["."] + pruneopts = "UT" + revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1" + version = "v1.20.0" + +[[projects]] + branch = "master" + digest = "1:3f3a05ae0b95893d90b9b3b5afdb79a9b3d96e4e36e099d841ae602e4aca0da8" + name = "golang.org/x/crypto" + packages = ["ssh/terminal"] + pruneopts = "UT" + revision = "c126467f60eb25f8f27e5a981f32a87e3965053f" + +[[projects]] + branch = "master" + digest = "1:4a7c38ff146e5002dda78fdf599ac143fd0c98ffba9fb9d1721c3ba7fcd356c0" + name = "golang.org/x/sys" + packages = [ + "unix", + "windows", + ] + pruneopts = "UT" + revision = "3dc4335d56c789b04b0ba99b7a37249d9b614314" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + input-imports = [ + "github.com/Sirupsen/logrus", + "github.com/rancher/go-rancher/v2", + "github.com/urfave/cli", + ] + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 0000000..97ce5e7 --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,42 @@ +# Gopkg.toml example +# +# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" +# +# [prune] +# non-go = false +# go-tests = true +# unused-packages = true + + +[[constraint]] + name = "github.com/Sirupsen/logrus" + version = "1.0.6" + +[[constraint]] + branch = "master" + name = "github.com/rancher/go-rancher" + +[[constraint]] + name = "github.com/urfave/cli" + version = "1.20.0" + +[prune] + go-tests = true + unused-packages = true diff --git a/vendor/github.com/Sirupsen/logrus/CHANGELOG.md b/vendor/github.com/Sirupsen/logrus/CHANGELOG.md deleted file mode 100755 index f2c2bc2..0000000 --- a/vendor/github.com/Sirupsen/logrus/CHANGELOG.md +++ /dev/null @@ -1,66 +0,0 @@ -# 0.10.0 - -* feature: Add a test hook (#180) -* feature: `ParseLevel` is now case-insensitive (#326) -* feature: `FieldLogger` interface that generalizes `Logger` and `Entry` (#308) -* performance: avoid re-allocations on `WithFields` (#335) - -# 0.9.0 - -* logrus/text_formatter: don't emit empty msg -* logrus/hooks/airbrake: move out of main repository -* logrus/hooks/sentry: move out of main repository -* logrus/hooks/papertrail: move out of main repository -* logrus/hooks/bugsnag: move out of main repository -* logrus/core: run tests with `-race` -* logrus/core: detect TTY based on `stderr` -* logrus/core: support `WithError` on logger -* logrus/core: Solaris support - -# 0.8.7 - -* logrus/core: fix possible race (#216) -* logrus/doc: small typo fixes and doc improvements - - -# 0.8.6 - -* hooks/raven: allow passing an initialized client - -# 0.8.5 - -* logrus/core: revert #208 - -# 0.8.4 - -* formatter/text: fix data race (#218) - -# 0.8.3 - -* logrus/core: fix entry log level (#208) -* logrus/core: improve performance of text formatter by 40% -* logrus/core: expose `LevelHooks` type -* logrus/core: add support for DragonflyBSD and NetBSD -* formatter/text: print structs more verbosely - -# 0.8.2 - -* logrus: fix more Fatal family functions - -# 0.8.1 - -* logrus: fix not exiting on `Fatalf` and `Fatalln` - -# 0.8.0 - -* logrus: defaults to stderr instead of stdout -* hooks/sentry: add special field for `*http.Request` -* formatter/text: ignore Windows for colors - -# 0.7.3 - -* formatter/\*: allow configuration of timestamp layout - -# 0.7.2 - -* formatter/text: Add configuration option for time format (#158) diff --git a/vendor/github.com/Sirupsen/logrus/LICENSE b/vendor/github.com/Sirupsen/logrus/LICENSE deleted file mode 100755 index f090cb4..0000000 --- a/vendor/github.com/Sirupsen/logrus/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Simon Eskildsen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/Sirupsen/logrus/README.md b/vendor/github.com/Sirupsen/logrus/README.md deleted file mode 100755 index 6e1721a..0000000 --- a/vendor/github.com/Sirupsen/logrus/README.md +++ /dev/null @@ -1,388 +0,0 @@ -# Logrus :walrus: [![Build Status](https://travis-ci.org/Sirupsen/logrus.svg?branch=master)](https://travis-ci.org/Sirupsen/logrus) [![GoDoc](https://godoc.org/github.com/Sirupsen/logrus?status.svg)](https://godoc.org/github.com/Sirupsen/logrus) - -Logrus is a structured logger for Go (golang), completely API compatible with -the standard library logger. [Godoc][godoc]. **Please note the Logrus API is not -yet stable (pre 1.0). Logrus itself is completely stable and has been used in -many large deployments. The core API is unlikely to change much but please -version control your Logrus to make sure you aren't fetching latest `master` on -every build.** - -Nicely color-coded in development (when a TTY is attached, otherwise just -plain text): - -![Colored](http://i.imgur.com/PY7qMwd.png) - -With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash -or Splunk: - -```json -{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the -ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"} - -{"level":"warning","msg":"The group's number increased tremendously!", -"number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"} - -{"animal":"walrus","level":"info","msg":"A giant walrus appears!", -"size":10,"time":"2014-03-10 19:57:38.562500591 -0400 EDT"} - -{"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.", -"size":9,"time":"2014-03-10 19:57:38.562527896 -0400 EDT"} - -{"level":"fatal","msg":"The ice breaks!","number":100,"omg":true, -"time":"2014-03-10 19:57:38.562543128 -0400 EDT"} -``` - -With the default `log.SetFormatter(&log.TextFormatter{})` when a TTY is not -attached, the output is compatible with the -[logfmt](http://godoc.org/github.com/kr/logfmt) format: - -```text -time="2015-03-26T01:27:38-04:00" level=debug msg="Started observing beach" animal=walrus number=8 -time="2015-03-26T01:27:38-04:00" level=info msg="A group of walrus emerges from the ocean" animal=walrus size=10 -time="2015-03-26T01:27:38-04:00" level=warning msg="The group's number increased tremendously!" number=122 omg=true -time="2015-03-26T01:27:38-04:00" level=debug msg="Temperature changes" temperature=-4 -time="2015-03-26T01:27:38-04:00" level=panic msg="It's over 9000!" animal=orca size=9009 -time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" err=&{0x2082280c0 map[animal:orca size:9009] 2015-03-26 01:27:38.441574009 -0400 EDT panic It's over 9000!} number=100 omg=true -exit status 1 -``` - -#### Example - -The simplest way to use Logrus is simply the package-level exported logger: - -```go -package main - -import ( - log "github.com/Sirupsen/logrus" -) - -func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - }).Info("A walrus appears") -} -``` - -Note that it's completely api-compatible with the stdlib logger, so you can -replace your `log` imports everywhere with `log "github.com/Sirupsen/logrus"` -and you'll now have the flexibility of Logrus. You can customize it all you -want: - -```go -package main - -import ( - "os" - log "github.com/Sirupsen/logrus" -) - -func init() { - // Log as JSON instead of the default ASCII formatter. - log.SetFormatter(&log.JSONFormatter{}) - - // Output to stderr instead of stdout, could also be a file. - log.SetOutput(os.Stderr) - - // Only log the warning severity or above. - log.SetLevel(log.WarnLevel) -} - -func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") - - log.WithFields(log.Fields{ - "omg": true, - "number": 122, - }).Warn("The group's number increased tremendously!") - - log.WithFields(log.Fields{ - "omg": true, - "number": 100, - }).Fatal("The ice breaks!") - - // A common pattern is to re-use fields between logging statements by re-using - // the logrus.Entry returned from WithFields() - contextLogger := log.WithFields(log.Fields{ - "common": "this is a common field", - "other": "I also should be logged always", - }) - - contextLogger.Info("I'll be logged with common and other field") - contextLogger.Info("Me too") -} -``` - -For more advanced usage such as logging to multiple locations from the same -application, you can also create an instance of the `logrus` Logger: - -```go -package main - -import ( - "github.com/Sirupsen/logrus" -) - -// Create a new instance of the logger. You can have any number of instances. -var log = logrus.New() - -func main() { - // The API for setting attributes is a little different than the package level - // exported logger. See Godoc. - log.Out = os.Stderr - - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") -} -``` - -#### Fields - -Logrus encourages careful, structured logging though logging fields instead of -long, unparseable error messages. For example, instead of: `log.Fatalf("Failed -to send event %s to topic %s with key %d")`, you should log the much more -discoverable: - -```go -log.WithFields(log.Fields{ - "event": event, - "topic": topic, - "key": key, -}).Fatal("Failed to send event") -``` - -We've found this API forces you to think about logging in a way that produces -much more useful logging messages. We've been in countless situations where just -a single added field to a log statement that was already there would've saved us -hours. The `WithFields` call is optional. - -In general, with Logrus using any of the `printf`-family functions should be -seen as a hint you should add a field, however, you can still use the -`printf`-family functions with Logrus. - -#### Hooks - -You can add hooks for logging levels. For example to send errors to an exception -tracking service on `Error`, `Fatal` and `Panic`, info to StatsD or log to -multiple places simultaneously, e.g. syslog. - -Logrus comes with [built-in hooks](hooks/). Add those, or your custom hook, in -`init`: - -```go -import ( - log "github.com/Sirupsen/logrus" - "gopkg.in/gemnasium/logrus-airbrake-hook.v2" // the package is named "aibrake" - logrus_syslog "github.com/Sirupsen/logrus/hooks/syslog" - "log/syslog" -) - -func init() { - - // Use the Airbrake hook to report errors that have Error severity or above to - // an exception tracker. You can create custom hooks, see the Hooks section. - log.AddHook(airbrake.NewHook(123, "xyz", "production")) - - hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") - if err != nil { - log.Error("Unable to connect to local syslog daemon") - } else { - log.AddHook(hook) - } -} -``` -Note: Syslog hook also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md). - -| Hook | Description | -| ----- | ----------- | -| [Airbrake](https://github.com/gemnasium/logrus-airbrake-hook) | Send errors to the Airbrake API V3. Uses the official [`gobrake`](https://github.com/airbrake/gobrake) behind the scenes. | -| [Airbrake "legacy"](https://github.com/gemnasium/logrus-airbrake-legacy-hook) | Send errors to an exception tracking service compatible with the Airbrake API V2. Uses [`airbrake-go`](https://github.com/tobi/airbrake-go) behind the scenes. | -| [Papertrail](https://github.com/polds/logrus-papertrail-hook) | Send errors to the [Papertrail](https://papertrailapp.com) hosted logging service via UDP. | -| [Syslog](https://github.com/Sirupsen/logrus/blob/master/hooks/syslog/syslog.go) | Send errors to remote syslog server. Uses standard library `log/syslog` behind the scenes. | -| [Bugsnag](https://github.com/Shopify/logrus-bugsnag/blob/master/bugsnag.go) | Send errors to the Bugsnag exception tracking service. | -| [Sentry](https://github.com/evalphobia/logrus_sentry) | Send errors to the Sentry error logging and aggregation service. | -| [Hiprus](https://github.com/nubo/hiprus) | Send errors to a channel in hipchat. | -| [Logrusly](https://github.com/sebest/logrusly) | Send logs to [Loggly](https://www.loggly.com/) | -| [Slackrus](https://github.com/johntdyer/slackrus) | Hook for Slack chat. | -| [Journalhook](https://github.com/wercker/journalhook) | Hook for logging to `systemd-journald` | -| [Graylog](https://github.com/gemnasium/logrus-graylog-hook) | Hook for logging to [Graylog](http://graylog2.org/) | -| [Raygun](https://github.com/squirkle/logrus-raygun-hook) | Hook for logging to [Raygun.io](http://raygun.io/) | -| [LFShook](https://github.com/rifflock/lfshook) | Hook for logging to the local filesystem | -| [Honeybadger](https://github.com/agonzalezro/logrus_honeybadger) | Hook for sending exceptions to Honeybadger | -| [Mail](https://github.com/zbindenren/logrus_mail) | Hook for sending exceptions via mail | -| [Rollrus](https://github.com/heroku/rollrus) | Hook for sending errors to rollbar | -| [Fluentd](https://github.com/evalphobia/logrus_fluent) | Hook for logging to fluentd | -| [Mongodb](https://github.com/weekface/mgorus) | Hook for logging to mongodb | -| [InfluxDB](https://github.com/Abramovic/logrus_influxdb) | Hook for logging to influxdb | -| [Octokit](https://github.com/dorajistyle/logrus-octokit-hook) | Hook for logging to github via octokit | -| [DeferPanic](https://github.com/deferpanic/dp-logrus) | Hook for logging to DeferPanic | -| [Redis-Hook](https://github.com/rogierlommers/logrus-redis-hook) | Hook for logging to a ELK stack (through Redis) | -| [Amqp-Hook](https://github.com/vladoatanasov/logrus_amqp) | Hook for logging to Amqp broker (Like RabbitMQ) | -| [KafkaLogrus](https://github.com/goibibo/KafkaLogrus) | Hook for logging to kafka | -| [Typetalk](https://github.com/dragon3/logrus-typetalk-hook) | Hook for logging to [Typetalk](https://www.typetalk.in/) | -| [ElasticSearch](https://github.com/sohlich/elogrus) | Hook for logging to ElasticSearch| - - -#### Level logging - -Logrus has six logging levels: Debug, Info, Warning, Error, Fatal and Panic. - -```go -log.Debug("Useful debugging information.") -log.Info("Something noteworthy happened!") -log.Warn("You should probably take a look at this.") -log.Error("Something failed but I'm not quitting.") -// Calls os.Exit(1) after logging -log.Fatal("Bye.") -// Calls panic() after logging -log.Panic("I'm bailing.") -``` - -You can set the logging level on a `Logger`, then it will only log entries with -that severity or anything above it: - -```go -// Will log anything that is info or above (warn, error, fatal, panic). Default. -log.SetLevel(log.InfoLevel) -``` - -It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose -environment if your application has that. - -#### Entries - -Besides the fields added with `WithField` or `WithFields` some fields are -automatically added to all logging events: - -1. `time`. The timestamp when the entry was created. -2. `msg`. The logging message passed to `{Info,Warn,Error,Fatal,Panic}` after - the `AddFields` call. E.g. `Failed to send event.` -3. `level`. The logging level. E.g. `info`. - -#### Environments - -Logrus has no notion of environment. - -If you wish for hooks and formatters to only be used in specific environments, -you should handle that yourself. For example, if your application has a global -variable `Environment`, which is a string representation of the environment you -could do: - -```go -import ( - log "github.com/Sirupsen/logrus" -) - -init() { - // do something here to set environment depending on an environment variable - // or command-line flag - if Environment == "production" { - log.SetFormatter(&log.JSONFormatter{}) - } else { - // The TextFormatter is default, you don't actually have to do this. - log.SetFormatter(&log.TextFormatter{}) - } -} -``` - -This configuration is how `logrus` was intended to be used, but JSON in -production is mostly only useful if you do log aggregation with tools like -Splunk or Logstash. - -#### Formatters - -The built-in logging formatters are: - -* `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise - without colors. - * *Note:* to force colored output when there is no TTY, set the `ForceColors` - field to `true`. To force no colored output even if there is a TTY set the - `DisableColors` field to `true` -* `logrus.JSONFormatter`. Logs fields as JSON. -* `logrus/formatters/logstash.LogstashFormatter`. Logs fields as [Logstash](http://logstash.net) Events. - - ```go - logrus.SetFormatter(&logstash.LogstashFormatter{Type: "application_name"}) - ``` - -Third party logging formatters: - -* [`prefixed`](https://github.com/x-cray/logrus-prefixed-formatter). Displays log entry source along with alternative layout. -* [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the P͉̫o̳̼̊w̖͈̰͎e̬͔̭͂r͚̼̹̲ ̫͓͉̳͈ō̠͕͖̚f̝͍̠ ͕̲̞͖͑Z̖̫̤̫ͪa͉̬͈̗l͖͎g̳̥o̰̥̅!̣͔̲̻͊̄ ̙̘̦̹̦. - -You can define your formatter by implementing the `Formatter` interface, -requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a -`Fields` type (`map[string]interface{}`) with all your fields as well as the -default ones (see Entries section above): - -```go -type MyJSONFormatter struct { -} - -log.SetFormatter(new(MyJSONFormatter)) - -func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) { - // Note this doesn't include Time, Level and Message which are available on - // the Entry. Consult `godoc` on information about those fields or read the - // source of the official loggers. - serialized, err := json.Marshal(entry.Data) - if err != nil { - return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) - } - return append(serialized, '\n'), nil -} -``` - -#### Logger as an `io.Writer` - -Logrus can be transformed into an `io.Writer`. That writer is the end of an `io.Pipe` and it is your responsibility to close it. - -```go -w := logger.Writer() -defer w.Close() - -srv := http.Server{ - // create a stdlib log.Logger that writes to - // logrus.Logger. - ErrorLog: log.New(w, "", 0), -} -``` - -Each line written to that writer will be printed the usual way, using formatters -and hooks. The level for those entries is `info`. - -#### Rotation - -Log rotation is not provided with Logrus. Log rotation should be done by an -external program (like `logrotate(8)`) that can compress and delete old log -entries. It should not be a feature of the application-level logger. - -#### Tools - -| Tool | Description | -| ---- | ----------- | -|[Logrus Mate](https://github.com/gogap/logrus_mate)|Logrus mate is a tool for Logrus to manage loggers, you can initial logger's level, hook and formatter by config file, the logger will generated with different config at different environment.| - -#### Testing - -Logrus has a built in facility for asserting the presence of log messages. This is implemented through the `test` hook and provides: - -* decorators for existing logger (`test.NewLocal` and `test.NewGlobal`) which basically just add the `test` hook -* a test logger (`test.NewNullLogger`) that just records log messages (and does not output any): - -```go -logger, hook := NewNullLogger() -logger.Error("Hello error") - -assert.Equal(1, len(hook.Entries)) -assert.Equal(logrus.ErrorLevel, hook.LastEntry().Level) -assert.Equal("Hello error", hook.LastEntry().Message) - -hook.Reset() -assert.Nil(hook.LastEntry()) -``` diff --git a/vendor/github.com/Sirupsen/logrus/doc.go b/vendor/github.com/Sirupsen/logrus/doc.go deleted file mode 100755 index dddd5f8..0000000 --- a/vendor/github.com/Sirupsen/logrus/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -Package logrus is a structured logger for Go, completely API compatible with the standard library logger. - - -The simplest way to use Logrus is simply the package-level exported logger: - - package main - - import ( - log "github.com/Sirupsen/logrus" - ) - - func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - "number": 1, - "size": 10, - }).Info("A walrus appears") - } - -Output: - time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 - -For a full guide visit https://github.com/Sirupsen/logrus -*/ -package logrus diff --git a/vendor/github.com/Sirupsen/logrus/entry.go b/vendor/github.com/Sirupsen/logrus/entry.go deleted file mode 100755 index 89e966e..0000000 --- a/vendor/github.com/Sirupsen/logrus/entry.go +++ /dev/null @@ -1,264 +0,0 @@ -package logrus - -import ( - "bytes" - "fmt" - "io" - "os" - "time" -) - -// Defines the key when adding errors using WithError. -var ErrorKey = "error" - -// An entry is the final or intermediate Logrus logging entry. It contains all -// the fields passed with WithField{,s}. It's finally logged when Debug, Info, -// Warn, Error, Fatal or Panic is called on it. These objects can be reused and -// passed around as much as you wish to avoid field duplication. -type Entry struct { - Logger *Logger - - // Contains all the fields set by the user. - Data Fields - - // Time at which the log entry was created - Time time.Time - - // Level the log entry was logged at: Debug, Info, Warn, Error, Fatal or Panic - Level Level - - // Message passed to Debug, Info, Warn, Error, Fatal or Panic - Message string -} - -func NewEntry(logger *Logger) *Entry { - return &Entry{ - Logger: logger, - // Default is three fields, give a little extra room - Data: make(Fields, 5), - } -} - -// Returns a reader for the entry, which is a proxy to the formatter. -func (entry *Entry) Reader() (*bytes.Buffer, error) { - serialized, err := entry.Logger.Formatter.Format(entry) - return bytes.NewBuffer(serialized), err -} - -// Returns the string representation from the reader and ultimately the -// formatter. -func (entry *Entry) String() (string, error) { - reader, err := entry.Reader() - if err != nil { - return "", err - } - - return reader.String(), err -} - -// Add an error as single field (using the key defined in ErrorKey) to the Entry. -func (entry *Entry) WithError(err error) *Entry { - return entry.WithField(ErrorKey, err) -} - -// Add a single field to the Entry. -func (entry *Entry) WithField(key string, value interface{}) *Entry { - return entry.WithFields(Fields{key: value}) -} - -// Add a map of fields to the Entry. -func (entry *Entry) WithFields(fields Fields) *Entry { - data := make(Fields, len(entry.Data)+len(fields)) - for k, v := range entry.Data { - data[k] = v - } - for k, v := range fields { - data[k] = v - } - return &Entry{Logger: entry.Logger, Data: data} -} - -// This function is not declared with a pointer value because otherwise -// race conditions will occur when using multiple goroutines -func (entry Entry) log(level Level, msg string) { - entry.Time = time.Now() - entry.Level = level - entry.Message = msg - - if err := entry.Logger.Hooks.Fire(level, &entry); err != nil { - entry.Logger.mu.Lock() - fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err) - entry.Logger.mu.Unlock() - } - - reader, err := entry.Reader() - if err != nil { - entry.Logger.mu.Lock() - fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err) - entry.Logger.mu.Unlock() - } - - entry.Logger.mu.Lock() - defer entry.Logger.mu.Unlock() - - _, err = io.Copy(entry.Logger.Out, reader) - if err != nil { - fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err) - } - - // To avoid Entry#log() returning a value that only would make sense for - // panic() to use in Entry#Panic(), we avoid the allocation by checking - // directly here. - if level <= PanicLevel { - panic(&entry) - } -} - -func (entry *Entry) Debug(args ...interface{}) { - if entry.Logger.Level >= DebugLevel { - entry.log(DebugLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Print(args ...interface{}) { - entry.Info(args...) -} - -func (entry *Entry) Info(args ...interface{}) { - if entry.Logger.Level >= InfoLevel { - entry.log(InfoLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Warn(args ...interface{}) { - if entry.Logger.Level >= WarnLevel { - entry.log(WarnLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Warning(args ...interface{}) { - entry.Warn(args...) -} - -func (entry *Entry) Error(args ...interface{}) { - if entry.Logger.Level >= ErrorLevel { - entry.log(ErrorLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Fatal(args ...interface{}) { - if entry.Logger.Level >= FatalLevel { - entry.log(FatalLevel, fmt.Sprint(args...)) - } - os.Exit(1) -} - -func (entry *Entry) Panic(args ...interface{}) { - if entry.Logger.Level >= PanicLevel { - entry.log(PanicLevel, fmt.Sprint(args...)) - } - panic(fmt.Sprint(args...)) -} - -// Entry Printf family functions - -func (entry *Entry) Debugf(format string, args ...interface{}) { - if entry.Logger.Level >= DebugLevel { - entry.Debug(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Infof(format string, args ...interface{}) { - if entry.Logger.Level >= InfoLevel { - entry.Info(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Printf(format string, args ...interface{}) { - entry.Infof(format, args...) -} - -func (entry *Entry) Warnf(format string, args ...interface{}) { - if entry.Logger.Level >= WarnLevel { - entry.Warn(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Warningf(format string, args ...interface{}) { - entry.Warnf(format, args...) -} - -func (entry *Entry) Errorf(format string, args ...interface{}) { - if entry.Logger.Level >= ErrorLevel { - entry.Error(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Fatalf(format string, args ...interface{}) { - if entry.Logger.Level >= FatalLevel { - entry.Fatal(fmt.Sprintf(format, args...)) - } - os.Exit(1) -} - -func (entry *Entry) Panicf(format string, args ...interface{}) { - if entry.Logger.Level >= PanicLevel { - entry.Panic(fmt.Sprintf(format, args...)) - } -} - -// Entry Println family functions - -func (entry *Entry) Debugln(args ...interface{}) { - if entry.Logger.Level >= DebugLevel { - entry.Debug(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Infoln(args ...interface{}) { - if entry.Logger.Level >= InfoLevel { - entry.Info(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Println(args ...interface{}) { - entry.Infoln(args...) -} - -func (entry *Entry) Warnln(args ...interface{}) { - if entry.Logger.Level >= WarnLevel { - entry.Warn(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Warningln(args ...interface{}) { - entry.Warnln(args...) -} - -func (entry *Entry) Errorln(args ...interface{}) { - if entry.Logger.Level >= ErrorLevel { - entry.Error(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Fatalln(args ...interface{}) { - if entry.Logger.Level >= FatalLevel { - entry.Fatal(entry.sprintlnn(args...)) - } - os.Exit(1) -} - -func (entry *Entry) Panicln(args ...interface{}) { - if entry.Logger.Level >= PanicLevel { - entry.Panic(entry.sprintlnn(args...)) - } -} - -// Sprintlnn => Sprint no newline. This is to get the behavior of how -// fmt.Sprintln where spaces are always added between operands, regardless of -// their type. Instead of vendoring the Sprintln implementation to spare a -// string allocation, we do the simplest thing. -func (entry *Entry) sprintlnn(args ...interface{}) string { - msg := fmt.Sprintln(args...) - return msg[:len(msg)-1] -} diff --git a/vendor/github.com/Sirupsen/logrus/exported.go b/vendor/github.com/Sirupsen/logrus/exported.go deleted file mode 100755 index 9a0120a..0000000 --- a/vendor/github.com/Sirupsen/logrus/exported.go +++ /dev/null @@ -1,193 +0,0 @@ -package logrus - -import ( - "io" -) - -var ( - // std is the name of the standard logger in stdlib `log` - std = New() -) - -func StandardLogger() *Logger { - return std -} - -// SetOutput sets the standard logger output. -func SetOutput(out io.Writer) { - std.mu.Lock() - defer std.mu.Unlock() - std.Out = out -} - -// SetFormatter sets the standard logger formatter. -func SetFormatter(formatter Formatter) { - std.mu.Lock() - defer std.mu.Unlock() - std.Formatter = formatter -} - -// SetLevel sets the standard logger level. -func SetLevel(level Level) { - std.mu.Lock() - defer std.mu.Unlock() - std.Level = level -} - -// GetLevel returns the standard logger level. -func GetLevel() Level { - std.mu.Lock() - defer std.mu.Unlock() - return std.Level -} - -// AddHook adds a hook to the standard logger hooks. -func AddHook(hook Hook) { - std.mu.Lock() - defer std.mu.Unlock() - std.Hooks.Add(hook) -} - -// WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key. -func WithError(err error) *Entry { - return std.WithField(ErrorKey, err) -} - -// WithField creates an entry from the standard logger and adds a field to -// it. If you want multiple fields, use `WithFields`. -// -// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal -// or Panic on the Entry it returns. -func WithField(key string, value interface{}) *Entry { - return std.WithField(key, value) -} - -// WithFields creates an entry from the standard logger and adds multiple -// fields to it. This is simply a helper for `WithField`, invoking it -// once for each field. -// -// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal -// or Panic on the Entry it returns. -func WithFields(fields Fields) *Entry { - return std.WithFields(fields) -} - -// Debug logs a message at level Debug on the standard logger. -func Debug(args ...interface{}) { - std.Debug(args...) -} - -// Print logs a message at level Info on the standard logger. -func Print(args ...interface{}) { - std.Print(args...) -} - -// Info logs a message at level Info on the standard logger. -func Info(args ...interface{}) { - std.Info(args...) -} - -// Warn logs a message at level Warn on the standard logger. -func Warn(args ...interface{}) { - std.Warn(args...) -} - -// Warning logs a message at level Warn on the standard logger. -func Warning(args ...interface{}) { - std.Warning(args...) -} - -// Error logs a message at level Error on the standard logger. -func Error(args ...interface{}) { - std.Error(args...) -} - -// Panic logs a message at level Panic on the standard logger. -func Panic(args ...interface{}) { - std.Panic(args...) -} - -// Fatal logs a message at level Fatal on the standard logger. -func Fatal(args ...interface{}) { - std.Fatal(args...) -} - -// Debugf logs a message at level Debug on the standard logger. -func Debugf(format string, args ...interface{}) { - std.Debugf(format, args...) -} - -// Printf logs a message at level Info on the standard logger. -func Printf(format string, args ...interface{}) { - std.Printf(format, args...) -} - -// Infof logs a message at level Info on the standard logger. -func Infof(format string, args ...interface{}) { - std.Infof(format, args...) -} - -// Warnf logs a message at level Warn on the standard logger. -func Warnf(format string, args ...interface{}) { - std.Warnf(format, args...) -} - -// Warningf logs a message at level Warn on the standard logger. -func Warningf(format string, args ...interface{}) { - std.Warningf(format, args...) -} - -// Errorf logs a message at level Error on the standard logger. -func Errorf(format string, args ...interface{}) { - std.Errorf(format, args...) -} - -// Panicf logs a message at level Panic on the standard logger. -func Panicf(format string, args ...interface{}) { - std.Panicf(format, args...) -} - -// Fatalf logs a message at level Fatal on the standard logger. -func Fatalf(format string, args ...interface{}) { - std.Fatalf(format, args...) -} - -// Debugln logs a message at level Debug on the standard logger. -func Debugln(args ...interface{}) { - std.Debugln(args...) -} - -// Println logs a message at level Info on the standard logger. -func Println(args ...interface{}) { - std.Println(args...) -} - -// Infoln logs a message at level Info on the standard logger. -func Infoln(args ...interface{}) { - std.Infoln(args...) -} - -// Warnln logs a message at level Warn on the standard logger. -func Warnln(args ...interface{}) { - std.Warnln(args...) -} - -// Warningln logs a message at level Warn on the standard logger. -func Warningln(args ...interface{}) { - std.Warningln(args...) -} - -// Errorln logs a message at level Error on the standard logger. -func Errorln(args ...interface{}) { - std.Errorln(args...) -} - -// Panicln logs a message at level Panic on the standard logger. -func Panicln(args ...interface{}) { - std.Panicln(args...) -} - -// Fatalln logs a message at level Fatal on the standard logger. -func Fatalln(args ...interface{}) { - std.Fatalln(args...) -} diff --git a/vendor/github.com/Sirupsen/logrus/formatter.go b/vendor/github.com/Sirupsen/logrus/formatter.go deleted file mode 100755 index 104d689..0000000 --- a/vendor/github.com/Sirupsen/logrus/formatter.go +++ /dev/null @@ -1,48 +0,0 @@ -package logrus - -import "time" - -const DefaultTimestampFormat = time.RFC3339 - -// The Formatter interface is used to implement a custom Formatter. It takes an -// `Entry`. It exposes all the fields, including the default ones: -// -// * `entry.Data["msg"]`. The message passed from Info, Warn, Error .. -// * `entry.Data["time"]`. The timestamp. -// * `entry.Data["level"]. The level the entry was logged at. -// -// Any additional fields added with `WithField` or `WithFields` are also in -// `entry.Data`. Format is expected to return an array of bytes which are then -// logged to `logger.Out`. -type Formatter interface { - Format(*Entry) ([]byte, error) -} - -// This is to not silently overwrite `time`, `msg` and `level` fields when -// dumping it. If this code wasn't there doing: -// -// logrus.WithField("level", 1).Info("hello") -// -// Would just silently drop the user provided level. Instead with this code -// it'll logged as: -// -// {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."} -// -// It's not exported because it's still using Data in an opinionated way. It's to -// avoid code duplication between the two default formatters. -func prefixFieldClashes(data Fields) { - _, ok := data["time"] - if ok { - data["fields.time"] = data["time"] - } - - _, ok = data["msg"] - if ok { - data["fields.msg"] = data["msg"] - } - - _, ok = data["level"] - if ok { - data["fields.level"] = data["level"] - } -} diff --git a/vendor/github.com/Sirupsen/logrus/hooks.go b/vendor/github.com/Sirupsen/logrus/hooks.go deleted file mode 100755 index 3f151cd..0000000 --- a/vendor/github.com/Sirupsen/logrus/hooks.go +++ /dev/null @@ -1,34 +0,0 @@ -package logrus - -// A hook to be fired when logging on the logging levels returned from -// `Levels()` on your implementation of the interface. Note that this is not -// fired in a goroutine or a channel with workers, you should handle such -// functionality yourself if your call is non-blocking and you don't wish for -// the logging calls for levels returned from `Levels()` to block. -type Hook interface { - Levels() []Level - Fire(*Entry) error -} - -// Internal type for storing the hooks on a logger instance. -type LevelHooks map[Level][]Hook - -// Add a hook to an instance of logger. This is called with -// `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. -func (hooks LevelHooks) Add(hook Hook) { - for _, level := range hook.Levels() { - hooks[level] = append(hooks[level], hook) - } -} - -// Fire all the hooks for the passed level. Used by `entry.log` to fire -// appropriate hooks for a log entry. -func (hooks LevelHooks) Fire(level Level, entry *Entry) error { - for _, hook := range hooks[level] { - if err := hook.Fire(entry); err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/Sirupsen/logrus/json_formatter.go b/vendor/github.com/Sirupsen/logrus/json_formatter.go deleted file mode 100755 index 2ad6dc5..0000000 --- a/vendor/github.com/Sirupsen/logrus/json_formatter.go +++ /dev/null @@ -1,41 +0,0 @@ -package logrus - -import ( - "encoding/json" - "fmt" -) - -type JSONFormatter struct { - // TimestampFormat sets the format used for marshaling timestamps. - TimestampFormat string -} - -func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { - data := make(Fields, len(entry.Data)+3) - for k, v := range entry.Data { - switch v := v.(type) { - case error: - // Otherwise errors are ignored by `encoding/json` - // https://github.com/Sirupsen/logrus/issues/137 - data[k] = v.Error() - default: - data[k] = v - } - } - prefixFieldClashes(data) - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = DefaultTimestampFormat - } - - data["time"] = entry.Time.Format(timestampFormat) - data["msg"] = entry.Message - data["level"] = entry.Level.String() - - serialized, err := json.Marshal(data) - if err != nil { - return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) - } - return append(serialized, '\n'), nil -} diff --git a/vendor/github.com/Sirupsen/logrus/logger.go b/vendor/github.com/Sirupsen/logrus/logger.go deleted file mode 100755 index 2fdb231..0000000 --- a/vendor/github.com/Sirupsen/logrus/logger.go +++ /dev/null @@ -1,212 +0,0 @@ -package logrus - -import ( - "io" - "os" - "sync" -) - -type Logger struct { - // The logs are `io.Copy`'d to this in a mutex. It's common to set this to a - // file, or leave it default which is `os.Stderr`. You can also set this to - // something more adventorous, such as logging to Kafka. - Out io.Writer - // Hooks for the logger instance. These allow firing events based on logging - // levels and log entries. For example, to send errors to an error tracking - // service, log to StatsD or dump the core on fatal errors. - Hooks LevelHooks - // All log entries pass through the formatter before logged to Out. The - // included formatters are `TextFormatter` and `JSONFormatter` for which - // TextFormatter is the default. In development (when a TTY is attached) it - // logs with colors, but to a file it wouldn't. You can easily implement your - // own that implements the `Formatter` interface, see the `README` or included - // formatters for examples. - Formatter Formatter - // The logging level the logger should log at. This is typically (and defaults - // to) `logrus.Info`, which allows Info(), Warn(), Error() and Fatal() to be - // logged. `logrus.Debug` is useful in - Level Level - // Used to sync writing to the log. - mu sync.Mutex -} - -// Creates a new logger. Configuration should be set by changing `Formatter`, -// `Out` and `Hooks` directly on the default logger instance. You can also just -// instantiate your own: -// -// var log = &Logger{ -// Out: os.Stderr, -// Formatter: new(JSONFormatter), -// Hooks: make(LevelHooks), -// Level: logrus.DebugLevel, -// } -// -// It's recommended to make this a global instance called `log`. -func New() *Logger { - return &Logger{ - Out: os.Stderr, - Formatter: new(TextFormatter), - Hooks: make(LevelHooks), - Level: InfoLevel, - } -} - -// Adds a field to the log entry, note that you it doesn't log until you call -// Debug, Print, Info, Warn, Fatal or Panic. It only creates a log entry. -// If you want multiple fields, use `WithFields`. -func (logger *Logger) WithField(key string, value interface{}) *Entry { - return NewEntry(logger).WithField(key, value) -} - -// Adds a struct of fields to the log entry. All it does is call `WithField` for -// each `Field`. -func (logger *Logger) WithFields(fields Fields) *Entry { - return NewEntry(logger).WithFields(fields) -} - -// Add an error as single field to the log entry. All it does is call -// `WithError` for the given `error`. -func (logger *Logger) WithError(err error) *Entry { - return NewEntry(logger).WithError(err) -} - -func (logger *Logger) Debugf(format string, args ...interface{}) { - if logger.Level >= DebugLevel { - NewEntry(logger).Debugf(format, args...) - } -} - -func (logger *Logger) Infof(format string, args ...interface{}) { - if logger.Level >= InfoLevel { - NewEntry(logger).Infof(format, args...) - } -} - -func (logger *Logger) Printf(format string, args ...interface{}) { - NewEntry(logger).Printf(format, args...) -} - -func (logger *Logger) Warnf(format string, args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warnf(format, args...) - } -} - -func (logger *Logger) Warningf(format string, args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warnf(format, args...) - } -} - -func (logger *Logger) Errorf(format string, args ...interface{}) { - if logger.Level >= ErrorLevel { - NewEntry(logger).Errorf(format, args...) - } -} - -func (logger *Logger) Fatalf(format string, args ...interface{}) { - if logger.Level >= FatalLevel { - NewEntry(logger).Fatalf(format, args...) - } - os.Exit(1) -} - -func (logger *Logger) Panicf(format string, args ...interface{}) { - if logger.Level >= PanicLevel { - NewEntry(logger).Panicf(format, args...) - } -} - -func (logger *Logger) Debug(args ...interface{}) { - if logger.Level >= DebugLevel { - NewEntry(logger).Debug(args...) - } -} - -func (logger *Logger) Info(args ...interface{}) { - if logger.Level >= InfoLevel { - NewEntry(logger).Info(args...) - } -} - -func (logger *Logger) Print(args ...interface{}) { - NewEntry(logger).Info(args...) -} - -func (logger *Logger) Warn(args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warn(args...) - } -} - -func (logger *Logger) Warning(args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warn(args...) - } -} - -func (logger *Logger) Error(args ...interface{}) { - if logger.Level >= ErrorLevel { - NewEntry(logger).Error(args...) - } -} - -func (logger *Logger) Fatal(args ...interface{}) { - if logger.Level >= FatalLevel { - NewEntry(logger).Fatal(args...) - } - os.Exit(1) -} - -func (logger *Logger) Panic(args ...interface{}) { - if logger.Level >= PanicLevel { - NewEntry(logger).Panic(args...) - } -} - -func (logger *Logger) Debugln(args ...interface{}) { - if logger.Level >= DebugLevel { - NewEntry(logger).Debugln(args...) - } -} - -func (logger *Logger) Infoln(args ...interface{}) { - if logger.Level >= InfoLevel { - NewEntry(logger).Infoln(args...) - } -} - -func (logger *Logger) Println(args ...interface{}) { - NewEntry(logger).Println(args...) -} - -func (logger *Logger) Warnln(args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warnln(args...) - } -} - -func (logger *Logger) Warningln(args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warnln(args...) - } -} - -func (logger *Logger) Errorln(args ...interface{}) { - if logger.Level >= ErrorLevel { - NewEntry(logger).Errorln(args...) - } -} - -func (logger *Logger) Fatalln(args ...interface{}) { - if logger.Level >= FatalLevel { - NewEntry(logger).Fatalln(args...) - } - os.Exit(1) -} - -func (logger *Logger) Panicln(args ...interface{}) { - if logger.Level >= PanicLevel { - NewEntry(logger).Panicln(args...) - } -} diff --git a/vendor/github.com/Sirupsen/logrus/logrus.go b/vendor/github.com/Sirupsen/logrus/logrus.go deleted file mode 100755 index e596691..0000000 --- a/vendor/github.com/Sirupsen/logrus/logrus.go +++ /dev/null @@ -1,143 +0,0 @@ -package logrus - -import ( - "fmt" - "log" - "strings" -) - -// Fields type, used to pass to `WithFields`. -type Fields map[string]interface{} - -// Level type -type Level uint8 - -// Convert the Level to a string. E.g. PanicLevel becomes "panic". -func (level Level) String() string { - switch level { - case DebugLevel: - return "debug" - case InfoLevel: - return "info" - case WarnLevel: - return "warning" - case ErrorLevel: - return "error" - case FatalLevel: - return "fatal" - case PanicLevel: - return "panic" - } - - return "unknown" -} - -// ParseLevel takes a string level and returns the Logrus log level constant. -func ParseLevel(lvl string) (Level, error) { - switch strings.ToLower(lvl) { - case "panic": - return PanicLevel, nil - case "fatal": - return FatalLevel, nil - case "error": - return ErrorLevel, nil - case "warn", "warning": - return WarnLevel, nil - case "info": - return InfoLevel, nil - case "debug": - return DebugLevel, nil - } - - var l Level - return l, fmt.Errorf("not a valid logrus Level: %q", lvl) -} - -// A constant exposing all logging levels -var AllLevels = []Level{ - PanicLevel, - FatalLevel, - ErrorLevel, - WarnLevel, - InfoLevel, - DebugLevel, -} - -// These are the different logging levels. You can set the logging level to log -// on your instance of logger, obtained with `logrus.New()`. -const ( - // PanicLevel level, highest level of severity. Logs and then calls panic with the - // message passed to Debug, Info, ... - PanicLevel Level = iota - // FatalLevel level. Logs and then calls `os.Exit(1)`. It will exit even if the - // logging level is set to Panic. - FatalLevel - // ErrorLevel level. Logs. Used for errors that should definitely be noted. - // Commonly used for hooks to send errors to an error tracking service. - ErrorLevel - // WarnLevel level. Non-critical entries that deserve eyes. - WarnLevel - // InfoLevel level. General operational entries about what's going on inside the - // application. - InfoLevel - // DebugLevel level. Usually only enabled when debugging. Very verbose logging. - DebugLevel -) - -// Won't compile if StdLogger can't be realized by a log.Logger -var ( - _ StdLogger = &log.Logger{} - _ StdLogger = &Entry{} - _ StdLogger = &Logger{} -) - -// StdLogger is what your logrus-enabled library should take, that way -// it'll accept a stdlib logger and a logrus logger. There's no standard -// interface, this is the closest we get, unfortunately. -type StdLogger interface { - Print(...interface{}) - Printf(string, ...interface{}) - Println(...interface{}) - - Fatal(...interface{}) - Fatalf(string, ...interface{}) - Fatalln(...interface{}) - - Panic(...interface{}) - Panicf(string, ...interface{}) - Panicln(...interface{}) -} - -// The FieldLogger interface generalizes the Entry and Logger types -type FieldLogger interface { - WithField(key string, value interface{}) *Entry - WithFields(fields Fields) *Entry - WithError(err error) *Entry - - Debugf(format string, args ...interface{}) - Infof(format string, args ...interface{}) - Printf(format string, args ...interface{}) - Warnf(format string, args ...interface{}) - Warningf(format string, args ...interface{}) - Errorf(format string, args ...interface{}) - Fatalf(format string, args ...interface{}) - Panicf(format string, args ...interface{}) - - Debug(args ...interface{}) - Info(args ...interface{}) - Print(args ...interface{}) - Warn(args ...interface{}) - Warning(args ...interface{}) - Error(args ...interface{}) - Fatal(args ...interface{}) - Panic(args ...interface{}) - - Debugln(args ...interface{}) - Infoln(args ...interface{}) - Println(args ...interface{}) - Warnln(args ...interface{}) - Warningln(args ...interface{}) - Errorln(args ...interface{}) - Fatalln(args ...interface{}) - Panicln(args ...interface{}) -} diff --git a/vendor/github.com/Sirupsen/logrus/terminal_bsd.go b/vendor/github.com/Sirupsen/logrus/terminal_bsd.go deleted file mode 100755 index 71f8d67..0000000 --- a/vendor/github.com/Sirupsen/logrus/terminal_bsd.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build darwin freebsd openbsd netbsd dragonfly - -package logrus - -import "syscall" - -const ioctlReadTermios = syscall.TIOCGETA - -type Termios syscall.Termios diff --git a/vendor/github.com/Sirupsen/logrus/terminal_linux.go b/vendor/github.com/Sirupsen/logrus/terminal_linux.go deleted file mode 100755 index a2c0b40..0000000 --- a/vendor/github.com/Sirupsen/logrus/terminal_linux.go +++ /dev/null @@ -1,12 +0,0 @@ -// Based on ssh/terminal: -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package logrus - -import "syscall" - -const ioctlReadTermios = syscall.TCGETS - -type Termios syscall.Termios diff --git a/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go b/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go deleted file mode 100755 index b343b3a..0000000 --- a/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go +++ /dev/null @@ -1,21 +0,0 @@ -// Based on ssh/terminal: -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux darwin freebsd openbsd netbsd dragonfly - -package logrus - -import ( - "syscall" - "unsafe" -) - -// IsTerminal returns true if stderr's file descriptor is a terminal. -func IsTerminal() bool { - fd := syscall.Stderr - var termios Termios - _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) - return err == 0 -} diff --git a/vendor/github.com/Sirupsen/logrus/terminal_solaris.go b/vendor/github.com/Sirupsen/logrus/terminal_solaris.go deleted file mode 100755 index 3e70bf7..0000000 --- a/vendor/github.com/Sirupsen/logrus/terminal_solaris.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build solaris - -package logrus - -import ( - "os" - - "golang.org/x/sys/unix" -) - -// IsTerminal returns true if the given file descriptor is a terminal. -func IsTerminal() bool { - _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) - return err == nil -} diff --git a/vendor/github.com/Sirupsen/logrus/terminal_windows.go b/vendor/github.com/Sirupsen/logrus/terminal_windows.go deleted file mode 100755 index 0146845..0000000 --- a/vendor/github.com/Sirupsen/logrus/terminal_windows.go +++ /dev/null @@ -1,27 +0,0 @@ -// Based on ssh/terminal: -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package logrus - -import ( - "syscall" - "unsafe" -) - -var kernel32 = syscall.NewLazyDLL("kernel32.dll") - -var ( - procGetConsoleMode = kernel32.NewProc("GetConsoleMode") -) - -// IsTerminal returns true if stderr's file descriptor is a terminal. -func IsTerminal() bool { - fd := syscall.Stderr - var st uint32 - r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) - return r != 0 && e == 0 -} diff --git a/vendor/github.com/Sirupsen/logrus/text_formatter.go b/vendor/github.com/Sirupsen/logrus/text_formatter.go deleted file mode 100755 index 06ef202..0000000 --- a/vendor/github.com/Sirupsen/logrus/text_formatter.go +++ /dev/null @@ -1,161 +0,0 @@ -package logrus - -import ( - "bytes" - "fmt" - "runtime" - "sort" - "strings" - "time" -) - -const ( - nocolor = 0 - red = 31 - green = 32 - yellow = 33 - blue = 34 - gray = 37 -) - -var ( - baseTimestamp time.Time - isTerminal bool -) - -func init() { - baseTimestamp = time.Now() - isTerminal = IsTerminal() -} - -func miniTS() int { - return int(time.Since(baseTimestamp) / time.Second) -} - -type TextFormatter struct { - // Set to true to bypass checking for a TTY before outputting colors. - ForceColors bool - - // Force disabling colors. - DisableColors bool - - // Disable timestamp logging. useful when output is redirected to logging - // system that already adds timestamps. - DisableTimestamp bool - - // Enable logging the full timestamp when a TTY is attached instead of just - // the time passed since beginning of execution. - FullTimestamp bool - - // TimestampFormat to use for display when a full timestamp is printed - TimestampFormat string - - // The fields are sorted by default for a consistent output. For applications - // that log extremely frequently and don't use the JSON formatter this may not - // be desired. - DisableSorting bool -} - -func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { - var keys []string = make([]string, 0, len(entry.Data)) - for k := range entry.Data { - keys = append(keys, k) - } - - if !f.DisableSorting { - sort.Strings(keys) - } - - b := &bytes.Buffer{} - - prefixFieldClashes(entry.Data) - - isColorTerminal := isTerminal && (runtime.GOOS != "windows") - isColored := (f.ForceColors || isColorTerminal) && !f.DisableColors - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = DefaultTimestampFormat - } - if isColored { - f.printColored(b, entry, keys, timestampFormat) - } else { - if !f.DisableTimestamp { - f.appendKeyValue(b, "time", entry.Time.Format(timestampFormat)) - } - f.appendKeyValue(b, "level", entry.Level.String()) - if entry.Message != "" { - f.appendKeyValue(b, "msg", entry.Message) - } - for _, key := range keys { - f.appendKeyValue(b, key, entry.Data[key]) - } - } - - b.WriteByte('\n') - return b.Bytes(), nil -} - -func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []string, timestampFormat string) { - var levelColor int - switch entry.Level { - case DebugLevel: - levelColor = gray - case WarnLevel: - levelColor = yellow - case ErrorLevel, FatalLevel, PanicLevel: - levelColor = red - default: - levelColor = blue - } - - levelText := strings.ToUpper(entry.Level.String())[0:4] - - if !f.FullTimestamp { - fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%04d] %-44s ", levelColor, levelText, miniTS(), entry.Message) - } else { - fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%s] %-44s ", levelColor, levelText, entry.Time.Format(timestampFormat), entry.Message) - } - for _, k := range keys { - v := entry.Data[k] - fmt.Fprintf(b, " \x1b[%dm%s\x1b[0m=%+v", levelColor, k, v) - } -} - -func needsQuoting(text string) bool { - for _, ch := range text { - if !((ch >= 'a' && ch <= 'z') || - (ch >= 'A' && ch <= 'Z') || - (ch >= '0' && ch <= '9') || - ch == '-' || ch == '.') { - return false - } - } - return true -} - -func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}) { - - b.WriteString(key) - b.WriteByte('=') - - switch value := value.(type) { - case string: - if needsQuoting(value) { - b.WriteString(value) - } else { - fmt.Fprintf(b, "%q", value) - } - case error: - errmsg := value.Error() - if needsQuoting(errmsg) { - b.WriteString(errmsg) - } else { - fmt.Fprintf(b, "%q", value) - } - default: - fmt.Fprint(b, value) - } - - b.WriteByte(' ') -} diff --git a/vendor/github.com/Sirupsen/logrus/writer.go b/vendor/github.com/Sirupsen/logrus/writer.go deleted file mode 100755 index 1e30b1c..0000000 --- a/vendor/github.com/Sirupsen/logrus/writer.go +++ /dev/null @@ -1,31 +0,0 @@ -package logrus - -import ( - "bufio" - "io" - "runtime" -) - -func (logger *Logger) Writer() *io.PipeWriter { - reader, writer := io.Pipe() - - go logger.writerScanner(reader) - runtime.SetFinalizer(writer, writerFinalizer) - - return writer -} - -func (logger *Logger) writerScanner(reader *io.PipeReader) { - scanner := bufio.NewScanner(reader) - for scanner.Scan() { - logger.Print(scanner.Text()) - } - if err := scanner.Err(); err != nil { - logger.Errorf("Error while reading from Writer: %s", err) - } - reader.Close() -} - -func writerFinalizer(writer *io.PipeWriter) { - writer.Close() -} diff --git a/vendor/github.com/gorilla/websocket/AUTHORS b/vendor/github.com/gorilla/websocket/AUTHORS deleted file mode 100644 index b003eca..0000000 --- a/vendor/github.com/gorilla/websocket/AUTHORS +++ /dev/null @@ -1,8 +0,0 @@ -# This is the official list of Gorilla WebSocket authors for copyright -# purposes. -# -# Please keep the list sorted. - -Gary Burd -Joachim Bauch - diff --git a/vendor/github.com/gorilla/websocket/LICENSE b/vendor/github.com/gorilla/websocket/LICENSE deleted file mode 100644 index 9171c97..0000000 --- a/vendor/github.com/gorilla/websocket/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/gorilla/websocket/README.md b/vendor/github.com/gorilla/websocket/README.md deleted file mode 100644 index 33c3d2b..0000000 --- a/vendor/github.com/gorilla/websocket/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# Gorilla WebSocket - -Gorilla WebSocket is a [Go](http://golang.org/) implementation of the -[WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. - -[![Build Status](https://travis-ci.org/gorilla/websocket.svg?branch=master)](https://travis-ci.org/gorilla/websocket) -[![GoDoc](https://godoc.org/github.com/gorilla/websocket?status.svg)](https://godoc.org/github.com/gorilla/websocket) - -### Documentation - -* [API Reference](http://godoc.org/github.com/gorilla/websocket) -* [Chat example](https://github.com/gorilla/websocket/tree/master/examples/chat) -* [Command example](https://github.com/gorilla/websocket/tree/master/examples/command) -* [Client and server example](https://github.com/gorilla/websocket/tree/master/examples/echo) -* [File watch example](https://github.com/gorilla/websocket/tree/master/examples/filewatch) - -### Status - -The Gorilla WebSocket package provides a complete and tested implementation of -the [WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. The -package API is stable. - -### Installation - - go get github.com/gorilla/websocket - -### Protocol Compliance - -The Gorilla WebSocket package passes the server tests in the [Autobahn Test -Suite](http://autobahn.ws/testsuite) using the application in the [examples/autobahn -subdirectory](https://github.com/gorilla/websocket/tree/master/examples/autobahn). - -### Gorilla WebSocket compared with other packages - - - - - - - - - - - - - - - - - - -
github.com/gorillagolang.org/x/net
RFC 6455 Features
Passes Autobahn Test SuiteYesNo
Receive fragmented messageYesNo, see note 1
Send close messageYesNo
Send pings and receive pongsYesNo
Get the type of a received data messageYesYes, see note 2
Other Features
Compression ExtensionsExperimentalNo
Read message using io.ReaderYesNo, see note 3
Write message using io.WriteCloserYesNo, see note 3
- -Notes: - -1. Large messages are fragmented in [Chrome's new WebSocket implementation](http://www.ietf.org/mail-archive/web/hybi/current/msg10503.html). -2. The application can get the type of a received data message by implementing - a [Codec marshal](http://godoc.org/golang.org/x/net/websocket#Codec.Marshal) - function. -3. The go.net io.Reader and io.Writer operate across WebSocket frame boundaries. - Read returns when the input buffer is full or a frame boundary is - encountered. Each call to Write sends a single frame message. The Gorilla - io.Reader and io.WriteCloser operate on a single WebSocket message. - diff --git a/vendor/github.com/gorilla/websocket/client.go b/vendor/github.com/gorilla/websocket/client.go deleted file mode 100644 index 43a87c7..0000000 --- a/vendor/github.com/gorilla/websocket/client.go +++ /dev/null @@ -1,392 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bufio" - "bytes" - "crypto/tls" - "encoding/base64" - "errors" - "io" - "io/ioutil" - "net" - "net/http" - "net/url" - "strings" - "time" -) - -// ErrBadHandshake is returned when the server response to opening handshake is -// invalid. -var ErrBadHandshake = errors.New("websocket: bad handshake") - -var errInvalidCompression = errors.New("websocket: invalid compression negotiation") - -// NewClient creates a new client connection using the given net connection. -// The URL u specifies the host and request URI. Use requestHeader to specify -// the origin (Origin), subprotocols (Sec-WebSocket-Protocol) and cookies -// (Cookie). Use the response.Header to get the selected subprotocol -// (Sec-WebSocket-Protocol) and cookies (Set-Cookie). -// -// If the WebSocket handshake fails, ErrBadHandshake is returned along with a -// non-nil *http.Response so that callers can handle redirects, authentication, -// etc. -// -// Deprecated: Use Dialer instead. -func NewClient(netConn net.Conn, u *url.URL, requestHeader http.Header, readBufSize, writeBufSize int) (c *Conn, response *http.Response, err error) { - d := Dialer{ - ReadBufferSize: readBufSize, - WriteBufferSize: writeBufSize, - NetDial: func(net, addr string) (net.Conn, error) { - return netConn, nil - }, - } - return d.Dial(u.String(), requestHeader) -} - -// A Dialer contains options for connecting to WebSocket server. -type Dialer struct { - // NetDial specifies the dial function for creating TCP connections. If - // NetDial is nil, net.Dial is used. - NetDial func(network, addr string) (net.Conn, error) - - // Proxy specifies a function to return a proxy for a given - // Request. If the function returns a non-nil error, the - // request is aborted with the provided error. - // If Proxy is nil or returns a nil *URL, no proxy is used. - Proxy func(*http.Request) (*url.URL, error) - - // TLSClientConfig specifies the TLS configuration to use with tls.Client. - // If nil, the default configuration is used. - TLSClientConfig *tls.Config - - // HandshakeTimeout specifies the duration for the handshake to complete. - HandshakeTimeout time.Duration - - // ReadBufferSize and WriteBufferSize specify I/O buffer sizes. If a buffer - // size is zero, then a useful default size is used. The I/O buffer sizes - // do not limit the size of the messages that can be sent or received. - ReadBufferSize, WriteBufferSize int - - // Subprotocols specifies the client's requested subprotocols. - Subprotocols []string - - // EnableCompression specifies if the client should attempt to negotiate - // per message compression (RFC 7692). Setting this value to true does not - // guarantee that compression will be supported. Currently only "no context - // takeover" modes are supported. - EnableCompression bool - - // Jar specifies the cookie jar. - // If Jar is nil, cookies are not sent in requests and ignored - // in responses. - Jar http.CookieJar -} - -var errMalformedURL = errors.New("malformed ws or wss URL") - -// parseURL parses the URL. -// -// This function is a replacement for the standard library url.Parse function. -// In Go 1.4 and earlier, url.Parse loses information from the path. -func parseURL(s string) (*url.URL, error) { - // From the RFC: - // - // ws-URI = "ws:" "//" host [ ":" port ] path [ "?" query ] - // wss-URI = "wss:" "//" host [ ":" port ] path [ "?" query ] - var u url.URL - switch { - case strings.HasPrefix(s, "ws://"): - u.Scheme = "ws" - s = s[len("ws://"):] - case strings.HasPrefix(s, "wss://"): - u.Scheme = "wss" - s = s[len("wss://"):] - default: - return nil, errMalformedURL - } - - if i := strings.Index(s, "?"); i >= 0 { - u.RawQuery = s[i+1:] - s = s[:i] - } - - if i := strings.Index(s, "/"); i >= 0 { - u.Opaque = s[i:] - s = s[:i] - } else { - u.Opaque = "/" - } - - u.Host = s - - if strings.Contains(u.Host, "@") { - // Don't bother parsing user information because user information is - // not allowed in websocket URIs. - return nil, errMalformedURL - } - - return &u, nil -} - -func hostPortNoPort(u *url.URL) (hostPort, hostNoPort string) { - hostPort = u.Host - hostNoPort = u.Host - if i := strings.LastIndex(u.Host, ":"); i > strings.LastIndex(u.Host, "]") { - hostNoPort = hostNoPort[:i] - } else { - switch u.Scheme { - case "wss": - hostPort += ":443" - case "https": - hostPort += ":443" - default: - hostPort += ":80" - } - } - return hostPort, hostNoPort -} - -// DefaultDialer is a dialer with all fields set to the default zero values. -var DefaultDialer = &Dialer{ - Proxy: http.ProxyFromEnvironment, -} - -// Dial creates a new client connection. Use requestHeader to specify the -// origin (Origin), subprotocols (Sec-WebSocket-Protocol) and cookies (Cookie). -// Use the response.Header to get the selected subprotocol -// (Sec-WebSocket-Protocol) and cookies (Set-Cookie). -// -// If the WebSocket handshake fails, ErrBadHandshake is returned along with a -// non-nil *http.Response so that callers can handle redirects, authentication, -// etcetera. The response body may not contain the entire response and does not -// need to be closed by the application. -func (d *Dialer) Dial(urlStr string, requestHeader http.Header) (*Conn, *http.Response, error) { - - if d == nil { - d = &Dialer{ - Proxy: http.ProxyFromEnvironment, - } - } - - challengeKey, err := generateChallengeKey() - if err != nil { - return nil, nil, err - } - - u, err := parseURL(urlStr) - if err != nil { - return nil, nil, err - } - - switch u.Scheme { - case "ws": - u.Scheme = "http" - case "wss": - u.Scheme = "https" - default: - return nil, nil, errMalformedURL - } - - if u.User != nil { - // User name and password are not allowed in websocket URIs. - return nil, nil, errMalformedURL - } - - req := &http.Request{ - Method: "GET", - URL: u, - Proto: "HTTP/1.1", - ProtoMajor: 1, - ProtoMinor: 1, - Header: make(http.Header), - Host: u.Host, - } - - // Set the cookies present in the cookie jar of the dialer - if d.Jar != nil { - for _, cookie := range d.Jar.Cookies(u) { - req.AddCookie(cookie) - } - } - - // Set the request headers using the capitalization for names and values in - // RFC examples. Although the capitalization shouldn't matter, there are - // servers that depend on it. The Header.Set method is not used because the - // method canonicalizes the header names. - req.Header["Upgrade"] = []string{"websocket"} - req.Header["Connection"] = []string{"Upgrade"} - req.Header["Sec-WebSocket-Key"] = []string{challengeKey} - req.Header["Sec-WebSocket-Version"] = []string{"13"} - if len(d.Subprotocols) > 0 { - req.Header["Sec-WebSocket-Protocol"] = []string{strings.Join(d.Subprotocols, ", ")} - } - for k, vs := range requestHeader { - switch { - case k == "Host": - if len(vs) > 0 { - req.Host = vs[0] - } - case k == "Upgrade" || - k == "Connection" || - k == "Sec-Websocket-Key" || - k == "Sec-Websocket-Version" || - k == "Sec-Websocket-Extensions" || - (k == "Sec-Websocket-Protocol" && len(d.Subprotocols) > 0): - return nil, nil, errors.New("websocket: duplicate header not allowed: " + k) - default: - req.Header[k] = vs - } - } - - if d.EnableCompression { - req.Header.Set("Sec-Websocket-Extensions", "permessage-deflate; server_no_context_takeover; client_no_context_takeover") - } - - hostPort, hostNoPort := hostPortNoPort(u) - - var proxyURL *url.URL - // Check wether the proxy method has been configured - if d.Proxy != nil { - proxyURL, err = d.Proxy(req) - } - if err != nil { - return nil, nil, err - } - - var targetHostPort string - if proxyURL != nil { - targetHostPort, _ = hostPortNoPort(proxyURL) - } else { - targetHostPort = hostPort - } - - var deadline time.Time - if d.HandshakeTimeout != 0 { - deadline = time.Now().Add(d.HandshakeTimeout) - } - - netDial := d.NetDial - if netDial == nil { - netDialer := &net.Dialer{Deadline: deadline} - netDial = netDialer.Dial - } - - netConn, err := netDial("tcp", targetHostPort) - if err != nil { - return nil, nil, err - } - - defer func() { - if netConn != nil { - netConn.Close() - } - }() - - if err := netConn.SetDeadline(deadline); err != nil { - return nil, nil, err - } - - if proxyURL != nil { - connectHeader := make(http.Header) - if user := proxyURL.User; user != nil { - proxyUser := user.Username() - if proxyPassword, passwordSet := user.Password(); passwordSet { - credential := base64.StdEncoding.EncodeToString([]byte(proxyUser + ":" + proxyPassword)) - connectHeader.Set("Proxy-Authorization", "Basic "+credential) - } - } - connectReq := &http.Request{ - Method: "CONNECT", - URL: &url.URL{Opaque: hostPort}, - Host: hostPort, - Header: connectHeader, - } - - connectReq.Write(netConn) - - // Read response. - // Okay to use and discard buffered reader here, because - // TLS server will not speak until spoken to. - br := bufio.NewReader(netConn) - resp, err := http.ReadResponse(br, connectReq) - if err != nil { - return nil, nil, err - } - if resp.StatusCode != 200 { - f := strings.SplitN(resp.Status, " ", 2) - return nil, nil, errors.New(f[1]) - } - } - - if u.Scheme == "https" { - cfg := cloneTLSConfig(d.TLSClientConfig) - if cfg.ServerName == "" { - cfg.ServerName = hostNoPort - } - tlsConn := tls.Client(netConn, cfg) - netConn = tlsConn - if err := tlsConn.Handshake(); err != nil { - return nil, nil, err - } - if !cfg.InsecureSkipVerify { - if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil { - return nil, nil, err - } - } - } - - conn := newConn(netConn, false, d.ReadBufferSize, d.WriteBufferSize) - - if err := req.Write(netConn); err != nil { - return nil, nil, err - } - - resp, err := http.ReadResponse(conn.br, req) - if err != nil { - return nil, nil, err - } - - if d.Jar != nil { - if rc := resp.Cookies(); len(rc) > 0 { - d.Jar.SetCookies(u, rc) - } - } - - if resp.StatusCode != 101 || - !strings.EqualFold(resp.Header.Get("Upgrade"), "websocket") || - !strings.EqualFold(resp.Header.Get("Connection"), "upgrade") || - resp.Header.Get("Sec-Websocket-Accept") != computeAcceptKey(challengeKey) { - // Before closing the network connection on return from this - // function, slurp up some of the response to aid application - // debugging. - buf := make([]byte, 1024) - n, _ := io.ReadFull(resp.Body, buf) - resp.Body = ioutil.NopCloser(bytes.NewReader(buf[:n])) - return nil, resp, ErrBadHandshake - } - - for _, ext := range parseExtensions(resp.Header) { - if ext[""] != "permessage-deflate" { - continue - } - _, snct := ext["server_no_context_takeover"] - _, cnct := ext["client_no_context_takeover"] - if !snct || !cnct { - return nil, resp, errInvalidCompression - } - conn.newCompressionWriter = compressNoContextTakeover - conn.newDecompressionReader = decompressNoContextTakeover - break - } - - resp.Body = ioutil.NopCloser(bytes.NewReader([]byte{})) - conn.subprotocol = resp.Header.Get("Sec-Websocket-Protocol") - - netConn.SetDeadline(time.Time{}) - netConn = nil // to avoid close in defer. - return conn, resp, nil -} diff --git a/vendor/github.com/gorilla/websocket/client_clone.go b/vendor/github.com/gorilla/websocket/client_clone.go deleted file mode 100644 index 4f0d943..0000000 --- a/vendor/github.com/gorilla/websocket/client_clone.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.8 - -package websocket - -import "crypto/tls" - -func cloneTLSConfig(cfg *tls.Config) *tls.Config { - if cfg == nil { - return &tls.Config{} - } - return cfg.Clone() -} diff --git a/vendor/github.com/gorilla/websocket/client_clone_legacy.go b/vendor/github.com/gorilla/websocket/client_clone_legacy.go deleted file mode 100644 index babb007..0000000 --- a/vendor/github.com/gorilla/websocket/client_clone_legacy.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.8 - -package websocket - -import "crypto/tls" - -// cloneTLSConfig clones all public fields except the fields -// SessionTicketsDisabled and SessionTicketKey. This avoids copying the -// sync.Mutex in the sync.Once and makes it safe to call cloneTLSConfig on a -// config in active use. -func cloneTLSConfig(cfg *tls.Config) *tls.Config { - if cfg == nil { - return &tls.Config{} - } - return &tls.Config{ - Rand: cfg.Rand, - Time: cfg.Time, - Certificates: cfg.Certificates, - NameToCertificate: cfg.NameToCertificate, - GetCertificate: cfg.GetCertificate, - RootCAs: cfg.RootCAs, - NextProtos: cfg.NextProtos, - ServerName: cfg.ServerName, - ClientAuth: cfg.ClientAuth, - ClientCAs: cfg.ClientCAs, - InsecureSkipVerify: cfg.InsecureSkipVerify, - CipherSuites: cfg.CipherSuites, - PreferServerCipherSuites: cfg.PreferServerCipherSuites, - ClientSessionCache: cfg.ClientSessionCache, - MinVersion: cfg.MinVersion, - MaxVersion: cfg.MaxVersion, - CurvePreferences: cfg.CurvePreferences, - } -} diff --git a/vendor/github.com/gorilla/websocket/compression.go b/vendor/github.com/gorilla/websocket/compression.go deleted file mode 100644 index 813ffb1..0000000 --- a/vendor/github.com/gorilla/websocket/compression.go +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2017 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "compress/flate" - "errors" - "io" - "strings" - "sync" -) - -const ( - minCompressionLevel = -2 // flate.HuffmanOnly not defined in Go < 1.6 - maxCompressionLevel = flate.BestCompression - defaultCompressionLevel = 1 -) - -var ( - flateWriterPools [maxCompressionLevel - minCompressionLevel + 1]sync.Pool - flateReaderPool = sync.Pool{New: func() interface{} { - return flate.NewReader(nil) - }} -) - -func decompressNoContextTakeover(r io.Reader) io.ReadCloser { - const tail = - // Add four bytes as specified in RFC - "\x00\x00\xff\xff" + - // Add final block to squelch unexpected EOF error from flate reader. - "\x01\x00\x00\xff\xff" - - fr, _ := flateReaderPool.Get().(io.ReadCloser) - fr.(flate.Resetter).Reset(io.MultiReader(r, strings.NewReader(tail)), nil) - return &flateReadWrapper{fr} -} - -func isValidCompressionLevel(level int) bool { - return minCompressionLevel <= level && level <= maxCompressionLevel -} - -func compressNoContextTakeover(w io.WriteCloser, level int) io.WriteCloser { - p := &flateWriterPools[level-minCompressionLevel] - tw := &truncWriter{w: w} - fw, _ := p.Get().(*flate.Writer) - if fw == nil { - fw, _ = flate.NewWriter(tw, level) - } else { - fw.Reset(tw) - } - return &flateWriteWrapper{fw: fw, tw: tw, p: p} -} - -// truncWriter is an io.Writer that writes all but the last four bytes of the -// stream to another io.Writer. -type truncWriter struct { - w io.WriteCloser - n int - p [4]byte -} - -func (w *truncWriter) Write(p []byte) (int, error) { - n := 0 - - // fill buffer first for simplicity. - if w.n < len(w.p) { - n = copy(w.p[w.n:], p) - p = p[n:] - w.n += n - if len(p) == 0 { - return n, nil - } - } - - m := len(p) - if m > len(w.p) { - m = len(w.p) - } - - if nn, err := w.w.Write(w.p[:m]); err != nil { - return n + nn, err - } - - copy(w.p[:], w.p[m:]) - copy(w.p[len(w.p)-m:], p[len(p)-m:]) - nn, err := w.w.Write(p[:len(p)-m]) - return n + nn, err -} - -type flateWriteWrapper struct { - fw *flate.Writer - tw *truncWriter - p *sync.Pool -} - -func (w *flateWriteWrapper) Write(p []byte) (int, error) { - if w.fw == nil { - return 0, errWriteClosed - } - return w.fw.Write(p) -} - -func (w *flateWriteWrapper) Close() error { - if w.fw == nil { - return errWriteClosed - } - err1 := w.fw.Flush() - w.p.Put(w.fw) - w.fw = nil - if w.tw.p != [4]byte{0, 0, 0xff, 0xff} { - return errors.New("websocket: internal error, unexpected bytes at end of flate stream") - } - err2 := w.tw.w.Close() - if err1 != nil { - return err1 - } - return err2 -} - -type flateReadWrapper struct { - fr io.ReadCloser -} - -func (r *flateReadWrapper) Read(p []byte) (int, error) { - if r.fr == nil { - return 0, io.ErrClosedPipe - } - n, err := r.fr.Read(p) - if err == io.EOF { - // Preemptively place the reader back in the pool. This helps with - // scenarios where the application does not call NextReader() soon after - // this final read. - r.Close() - } - return n, err -} - -func (r *flateReadWrapper) Close() error { - if r.fr == nil { - return io.ErrClosedPipe - } - err := r.fr.Close() - flateReaderPool.Put(r.fr) - r.fr = nil - return err -} diff --git a/vendor/github.com/gorilla/websocket/conn.go b/vendor/github.com/gorilla/websocket/conn.go deleted file mode 100644 index 97e1dba..0000000 --- a/vendor/github.com/gorilla/websocket/conn.go +++ /dev/null @@ -1,1149 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bufio" - "encoding/binary" - "errors" - "io" - "io/ioutil" - "math/rand" - "net" - "strconv" - "sync" - "time" - "unicode/utf8" -) - -const ( - // Frame header byte 0 bits from Section 5.2 of RFC 6455 - finalBit = 1 << 7 - rsv1Bit = 1 << 6 - rsv2Bit = 1 << 5 - rsv3Bit = 1 << 4 - - // Frame header byte 1 bits from Section 5.2 of RFC 6455 - maskBit = 1 << 7 - - maxFrameHeaderSize = 2 + 8 + 4 // Fixed header + length + mask - maxControlFramePayloadSize = 125 - - writeWait = time.Second - - defaultReadBufferSize = 4096 - defaultWriteBufferSize = 4096 - - continuationFrame = 0 - noFrame = -1 -) - -// Close codes defined in RFC 6455, section 11.7. -const ( - CloseNormalClosure = 1000 - CloseGoingAway = 1001 - CloseProtocolError = 1002 - CloseUnsupportedData = 1003 - CloseNoStatusReceived = 1005 - CloseAbnormalClosure = 1006 - CloseInvalidFramePayloadData = 1007 - ClosePolicyViolation = 1008 - CloseMessageTooBig = 1009 - CloseMandatoryExtension = 1010 - CloseInternalServerErr = 1011 - CloseServiceRestart = 1012 - CloseTryAgainLater = 1013 - CloseTLSHandshake = 1015 -) - -// The message types are defined in RFC 6455, section 11.8. -const ( - // TextMessage denotes a text data message. The text message payload is - // interpreted as UTF-8 encoded text data. - TextMessage = 1 - - // BinaryMessage denotes a binary data message. - BinaryMessage = 2 - - // CloseMessage denotes a close control message. The optional message - // payload contains a numeric code and text. Use the FormatCloseMessage - // function to format a close message payload. - CloseMessage = 8 - - // PingMessage denotes a ping control message. The optional message payload - // is UTF-8 encoded text. - PingMessage = 9 - - // PongMessage denotes a ping control message. The optional message payload - // is UTF-8 encoded text. - PongMessage = 10 -) - -// ErrCloseSent is returned when the application writes a message to the -// connection after sending a close message. -var ErrCloseSent = errors.New("websocket: close sent") - -// ErrReadLimit is returned when reading a message that is larger than the -// read limit set for the connection. -var ErrReadLimit = errors.New("websocket: read limit exceeded") - -// netError satisfies the net Error interface. -type netError struct { - msg string - temporary bool - timeout bool -} - -func (e *netError) Error() string { return e.msg } -func (e *netError) Temporary() bool { return e.temporary } -func (e *netError) Timeout() bool { return e.timeout } - -// CloseError represents close frame. -type CloseError struct { - - // Code is defined in RFC 6455, section 11.7. - Code int - - // Text is the optional text payload. - Text string -} - -func (e *CloseError) Error() string { - s := []byte("websocket: close ") - s = strconv.AppendInt(s, int64(e.Code), 10) - switch e.Code { - case CloseNormalClosure: - s = append(s, " (normal)"...) - case CloseGoingAway: - s = append(s, " (going away)"...) - case CloseProtocolError: - s = append(s, " (protocol error)"...) - case CloseUnsupportedData: - s = append(s, " (unsupported data)"...) - case CloseNoStatusReceived: - s = append(s, " (no status)"...) - case CloseAbnormalClosure: - s = append(s, " (abnormal closure)"...) - case CloseInvalidFramePayloadData: - s = append(s, " (invalid payload data)"...) - case ClosePolicyViolation: - s = append(s, " (policy violation)"...) - case CloseMessageTooBig: - s = append(s, " (message too big)"...) - case CloseMandatoryExtension: - s = append(s, " (mandatory extension missing)"...) - case CloseInternalServerErr: - s = append(s, " (internal server error)"...) - case CloseTLSHandshake: - s = append(s, " (TLS handshake error)"...) - } - if e.Text != "" { - s = append(s, ": "...) - s = append(s, e.Text...) - } - return string(s) -} - -// IsCloseError returns boolean indicating whether the error is a *CloseError -// with one of the specified codes. -func IsCloseError(err error, codes ...int) bool { - if e, ok := err.(*CloseError); ok { - for _, code := range codes { - if e.Code == code { - return true - } - } - } - return false -} - -// IsUnexpectedCloseError returns boolean indicating whether the error is a -// *CloseError with a code not in the list of expected codes. -func IsUnexpectedCloseError(err error, expectedCodes ...int) bool { - if e, ok := err.(*CloseError); ok { - for _, code := range expectedCodes { - if e.Code == code { - return false - } - } - return true - } - return false -} - -var ( - errWriteTimeout = &netError{msg: "websocket: write timeout", timeout: true, temporary: true} - errUnexpectedEOF = &CloseError{Code: CloseAbnormalClosure, Text: io.ErrUnexpectedEOF.Error()} - errBadWriteOpCode = errors.New("websocket: bad write message type") - errWriteClosed = errors.New("websocket: write closed") - errInvalidControlFrame = errors.New("websocket: invalid control frame") -) - -func newMaskKey() [4]byte { - n := rand.Uint32() - return [4]byte{byte(n), byte(n >> 8), byte(n >> 16), byte(n >> 24)} -} - -func hideTempErr(err error) error { - if e, ok := err.(net.Error); ok && e.Temporary() { - err = &netError{msg: e.Error(), timeout: e.Timeout()} - } - return err -} - -func isControl(frameType int) bool { - return frameType == CloseMessage || frameType == PingMessage || frameType == PongMessage -} - -func isData(frameType int) bool { - return frameType == TextMessage || frameType == BinaryMessage -} - -var validReceivedCloseCodes = map[int]bool{ - // see http://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number - - CloseNormalClosure: true, - CloseGoingAway: true, - CloseProtocolError: true, - CloseUnsupportedData: true, - CloseNoStatusReceived: false, - CloseAbnormalClosure: false, - CloseInvalidFramePayloadData: true, - ClosePolicyViolation: true, - CloseMessageTooBig: true, - CloseMandatoryExtension: true, - CloseInternalServerErr: true, - CloseServiceRestart: true, - CloseTryAgainLater: true, - CloseTLSHandshake: false, -} - -func isValidReceivedCloseCode(code int) bool { - return validReceivedCloseCodes[code] || (code >= 3000 && code <= 4999) -} - -// The Conn type represents a WebSocket connection. -type Conn struct { - conn net.Conn - isServer bool - subprotocol string - - // Write fields - mu chan bool // used as mutex to protect write to conn - writeBuf []byte // frame is constructed in this buffer. - writeDeadline time.Time - writer io.WriteCloser // the current writer returned to the application - isWriting bool // for best-effort concurrent write detection - - writeErrMu sync.Mutex - writeErr error - - enableWriteCompression bool - compressionLevel int - newCompressionWriter func(io.WriteCloser, int) io.WriteCloser - - // Read fields - reader io.ReadCloser // the current reader returned to the application - readErr error - br *bufio.Reader - readRemaining int64 // bytes remaining in current frame. - readFinal bool // true the current message has more frames. - readLength int64 // Message size. - readLimit int64 // Maximum message size. - readMaskPos int - readMaskKey [4]byte - handlePong func(string) error - handlePing func(string) error - handleClose func(int, string) error - readErrCount int - messageReader *messageReader // the current low-level reader - - readDecompress bool // whether last read frame had RSV1 set - newDecompressionReader func(io.Reader) io.ReadCloser -} - -func newConn(conn net.Conn, isServer bool, readBufferSize, writeBufferSize int) *Conn { - return newConnBRW(conn, isServer, readBufferSize, writeBufferSize, nil) -} - -type writeHook struct { - p []byte -} - -func (wh *writeHook) Write(p []byte) (int, error) { - wh.p = p - return len(p), nil -} - -func newConnBRW(conn net.Conn, isServer bool, readBufferSize, writeBufferSize int, brw *bufio.ReadWriter) *Conn { - mu := make(chan bool, 1) - mu <- true - - var br *bufio.Reader - if readBufferSize == 0 && brw != nil && brw.Reader != nil { - // Reuse the supplied bufio.Reader if the buffer has a useful size. - // This code assumes that peek on a reader returns - // bufio.Reader.buf[:0]. - brw.Reader.Reset(conn) - if p, err := brw.Reader.Peek(0); err == nil && cap(p) >= 256 { - br = brw.Reader - } - } - if br == nil { - if readBufferSize == 0 { - readBufferSize = defaultReadBufferSize - } - if readBufferSize < maxControlFramePayloadSize { - readBufferSize = maxControlFramePayloadSize - } - br = bufio.NewReaderSize(conn, readBufferSize) - } - - var writeBuf []byte - if writeBufferSize == 0 && brw != nil && brw.Writer != nil { - // Use the bufio.Writer's buffer if the buffer has a useful size. This - // code assumes that bufio.Writer.buf[:1] is passed to the - // bufio.Writer's underlying writer. - var wh writeHook - brw.Writer.Reset(&wh) - brw.Writer.WriteByte(0) - brw.Flush() - if cap(wh.p) >= maxFrameHeaderSize+256 { - writeBuf = wh.p[:cap(wh.p)] - } - } - - if writeBuf == nil { - if writeBufferSize == 0 { - writeBufferSize = defaultWriteBufferSize - } - writeBuf = make([]byte, writeBufferSize+maxFrameHeaderSize) - } - - c := &Conn{ - isServer: isServer, - br: br, - conn: conn, - mu: mu, - readFinal: true, - writeBuf: writeBuf, - enableWriteCompression: true, - compressionLevel: defaultCompressionLevel, - } - c.SetCloseHandler(nil) - c.SetPingHandler(nil) - c.SetPongHandler(nil) - return c -} - -// Subprotocol returns the negotiated protocol for the connection. -func (c *Conn) Subprotocol() string { - return c.subprotocol -} - -// Close closes the underlying network connection without sending or waiting for a close frame. -func (c *Conn) Close() error { - return c.conn.Close() -} - -// LocalAddr returns the local network address. -func (c *Conn) LocalAddr() net.Addr { - return c.conn.LocalAddr() -} - -// RemoteAddr returns the remote network address. -func (c *Conn) RemoteAddr() net.Addr { - return c.conn.RemoteAddr() -} - -// Write methods - -func (c *Conn) writeFatal(err error) error { - err = hideTempErr(err) - c.writeErrMu.Lock() - if c.writeErr == nil { - c.writeErr = err - } - c.writeErrMu.Unlock() - return err -} - -func (c *Conn) write(frameType int, deadline time.Time, bufs ...[]byte) error { - <-c.mu - defer func() { c.mu <- true }() - - c.writeErrMu.Lock() - err := c.writeErr - c.writeErrMu.Unlock() - if err != nil { - return err - } - - c.conn.SetWriteDeadline(deadline) - for _, buf := range bufs { - if len(buf) > 0 { - _, err := c.conn.Write(buf) - if err != nil { - return c.writeFatal(err) - } - } - } - - if frameType == CloseMessage { - c.writeFatal(ErrCloseSent) - } - return nil -} - -// WriteControl writes a control message with the given deadline. The allowed -// message types are CloseMessage, PingMessage and PongMessage. -func (c *Conn) WriteControl(messageType int, data []byte, deadline time.Time) error { - if !isControl(messageType) { - return errBadWriteOpCode - } - if len(data) > maxControlFramePayloadSize { - return errInvalidControlFrame - } - - b0 := byte(messageType) | finalBit - b1 := byte(len(data)) - if !c.isServer { - b1 |= maskBit - } - - buf := make([]byte, 0, maxFrameHeaderSize+maxControlFramePayloadSize) - buf = append(buf, b0, b1) - - if c.isServer { - buf = append(buf, data...) - } else { - key := newMaskKey() - buf = append(buf, key[:]...) - buf = append(buf, data...) - maskBytes(key, 0, buf[6:]) - } - - d := time.Hour * 1000 - if !deadline.IsZero() { - d = deadline.Sub(time.Now()) - if d < 0 { - return errWriteTimeout - } - } - - timer := time.NewTimer(d) - select { - case <-c.mu: - timer.Stop() - case <-timer.C: - return errWriteTimeout - } - defer func() { c.mu <- true }() - - c.writeErrMu.Lock() - err := c.writeErr - c.writeErrMu.Unlock() - if err != nil { - return err - } - - c.conn.SetWriteDeadline(deadline) - _, err = c.conn.Write(buf) - if err != nil { - return c.writeFatal(err) - } - if messageType == CloseMessage { - c.writeFatal(ErrCloseSent) - } - return err -} - -func (c *Conn) prepWrite(messageType int) error { - // Close previous writer if not already closed by the application. It's - // probably better to return an error in this situation, but we cannot - // change this without breaking existing applications. - if c.writer != nil { - c.writer.Close() - c.writer = nil - } - - if !isControl(messageType) && !isData(messageType) { - return errBadWriteOpCode - } - - c.writeErrMu.Lock() - err := c.writeErr - c.writeErrMu.Unlock() - return err -} - -// NextWriter returns a writer for the next message to send. The writer's Close -// method flushes the complete message to the network. -// -// There can be at most one open writer on a connection. NextWriter closes the -// previous writer if the application has not already done so. -func (c *Conn) NextWriter(messageType int) (io.WriteCloser, error) { - if err := c.prepWrite(messageType); err != nil { - return nil, err - } - - mw := &messageWriter{ - c: c, - frameType: messageType, - pos: maxFrameHeaderSize, - } - c.writer = mw - if c.newCompressionWriter != nil && c.enableWriteCompression && isData(messageType) { - w := c.newCompressionWriter(c.writer, c.compressionLevel) - mw.compress = true - c.writer = w - } - return c.writer, nil -} - -type messageWriter struct { - c *Conn - compress bool // whether next call to flushFrame should set RSV1 - pos int // end of data in writeBuf. - frameType int // type of the current frame. - err error -} - -func (w *messageWriter) fatal(err error) error { - if w.err != nil { - w.err = err - w.c.writer = nil - } - return err -} - -// flushFrame writes buffered data and extra as a frame to the network. The -// final argument indicates that this is the last frame in the message. -func (w *messageWriter) flushFrame(final bool, extra []byte) error { - c := w.c - length := w.pos - maxFrameHeaderSize + len(extra) - - // Check for invalid control frames. - if isControl(w.frameType) && - (!final || length > maxControlFramePayloadSize) { - return w.fatal(errInvalidControlFrame) - } - - b0 := byte(w.frameType) - if final { - b0 |= finalBit - } - if w.compress { - b0 |= rsv1Bit - } - w.compress = false - - b1 := byte(0) - if !c.isServer { - b1 |= maskBit - } - - // Assume that the frame starts at beginning of c.writeBuf. - framePos := 0 - if c.isServer { - // Adjust up if mask not included in the header. - framePos = 4 - } - - switch { - case length >= 65536: - c.writeBuf[framePos] = b0 - c.writeBuf[framePos+1] = b1 | 127 - binary.BigEndian.PutUint64(c.writeBuf[framePos+2:], uint64(length)) - case length > 125: - framePos += 6 - c.writeBuf[framePos] = b0 - c.writeBuf[framePos+1] = b1 | 126 - binary.BigEndian.PutUint16(c.writeBuf[framePos+2:], uint16(length)) - default: - framePos += 8 - c.writeBuf[framePos] = b0 - c.writeBuf[framePos+1] = b1 | byte(length) - } - - if !c.isServer { - key := newMaskKey() - copy(c.writeBuf[maxFrameHeaderSize-4:], key[:]) - maskBytes(key, 0, c.writeBuf[maxFrameHeaderSize:w.pos]) - if len(extra) > 0 { - return c.writeFatal(errors.New("websocket: internal error, extra used in client mode")) - } - } - - // Write the buffers to the connection with best-effort detection of - // concurrent writes. See the concurrency section in the package - // documentation for more info. - - if c.isWriting { - panic("concurrent write to websocket connection") - } - c.isWriting = true - - err := c.write(w.frameType, c.writeDeadline, c.writeBuf[framePos:w.pos], extra) - - if !c.isWriting { - panic("concurrent write to websocket connection") - } - c.isWriting = false - - if err != nil { - return w.fatal(err) - } - - if final { - c.writer = nil - return nil - } - - // Setup for next frame. - w.pos = maxFrameHeaderSize - w.frameType = continuationFrame - return nil -} - -func (w *messageWriter) ncopy(max int) (int, error) { - n := len(w.c.writeBuf) - w.pos - if n <= 0 { - if err := w.flushFrame(false, nil); err != nil { - return 0, err - } - n = len(w.c.writeBuf) - w.pos - } - if n > max { - n = max - } - return n, nil -} - -func (w *messageWriter) Write(p []byte) (int, error) { - if w.err != nil { - return 0, w.err - } - - if len(p) > 2*len(w.c.writeBuf) && w.c.isServer { - // Don't buffer large messages. - err := w.flushFrame(false, p) - if err != nil { - return 0, err - } - return len(p), nil - } - - nn := len(p) - for len(p) > 0 { - n, err := w.ncopy(len(p)) - if err != nil { - return 0, err - } - copy(w.c.writeBuf[w.pos:], p[:n]) - w.pos += n - p = p[n:] - } - return nn, nil -} - -func (w *messageWriter) WriteString(p string) (int, error) { - if w.err != nil { - return 0, w.err - } - - nn := len(p) - for len(p) > 0 { - n, err := w.ncopy(len(p)) - if err != nil { - return 0, err - } - copy(w.c.writeBuf[w.pos:], p[:n]) - w.pos += n - p = p[n:] - } - return nn, nil -} - -func (w *messageWriter) ReadFrom(r io.Reader) (nn int64, err error) { - if w.err != nil { - return 0, w.err - } - for { - if w.pos == len(w.c.writeBuf) { - err = w.flushFrame(false, nil) - if err != nil { - break - } - } - var n int - n, err = r.Read(w.c.writeBuf[w.pos:]) - w.pos += n - nn += int64(n) - if err != nil { - if err == io.EOF { - err = nil - } - break - } - } - return nn, err -} - -func (w *messageWriter) Close() error { - if w.err != nil { - return w.err - } - if err := w.flushFrame(true, nil); err != nil { - return err - } - w.err = errWriteClosed - return nil -} - -// WritePreparedMessage writes prepared message into connection. -func (c *Conn) WritePreparedMessage(pm *PreparedMessage) error { - frameType, frameData, err := pm.frame(prepareKey{ - isServer: c.isServer, - compress: c.newCompressionWriter != nil && c.enableWriteCompression && isData(pm.messageType), - compressionLevel: c.compressionLevel, - }) - if err != nil { - return err - } - if c.isWriting { - panic("concurrent write to websocket connection") - } - c.isWriting = true - err = c.write(frameType, c.writeDeadline, frameData, nil) - if !c.isWriting { - panic("concurrent write to websocket connection") - } - c.isWriting = false - return err -} - -// WriteMessage is a helper method for getting a writer using NextWriter, -// writing the message and closing the writer. -func (c *Conn) WriteMessage(messageType int, data []byte) error { - - if c.isServer && (c.newCompressionWriter == nil || !c.enableWriteCompression) { - // Fast path with no allocations and single frame. - - if err := c.prepWrite(messageType); err != nil { - return err - } - mw := messageWriter{c: c, frameType: messageType, pos: maxFrameHeaderSize} - n := copy(c.writeBuf[mw.pos:], data) - mw.pos += n - data = data[n:] - return mw.flushFrame(true, data) - } - - w, err := c.NextWriter(messageType) - if err != nil { - return err - } - if _, err = w.Write(data); err != nil { - return err - } - return w.Close() -} - -// SetWriteDeadline sets the write deadline on the underlying network -// connection. After a write has timed out, the websocket state is corrupt and -// all future writes will return an error. A zero value for t means writes will -// not time out. -func (c *Conn) SetWriteDeadline(t time.Time) error { - c.writeDeadline = t - return nil -} - -// Read methods - -func (c *Conn) advanceFrame() (int, error) { - - // 1. Skip remainder of previous frame. - - if c.readRemaining > 0 { - if _, err := io.CopyN(ioutil.Discard, c.br, c.readRemaining); err != nil { - return noFrame, err - } - } - - // 2. Read and parse first two bytes of frame header. - - p, err := c.read(2) - if err != nil { - return noFrame, err - } - - final := p[0]&finalBit != 0 - frameType := int(p[0] & 0xf) - mask := p[1]&maskBit != 0 - c.readRemaining = int64(p[1] & 0x7f) - - c.readDecompress = false - if c.newDecompressionReader != nil && (p[0]&rsv1Bit) != 0 { - c.readDecompress = true - p[0] &^= rsv1Bit - } - - if rsv := p[0] & (rsv1Bit | rsv2Bit | rsv3Bit); rsv != 0 { - return noFrame, c.handleProtocolError("unexpected reserved bits 0x" + strconv.FormatInt(int64(rsv), 16)) - } - - switch frameType { - case CloseMessage, PingMessage, PongMessage: - if c.readRemaining > maxControlFramePayloadSize { - return noFrame, c.handleProtocolError("control frame length > 125") - } - if !final { - return noFrame, c.handleProtocolError("control frame not final") - } - case TextMessage, BinaryMessage: - if !c.readFinal { - return noFrame, c.handleProtocolError("message start before final message frame") - } - c.readFinal = final - case continuationFrame: - if c.readFinal { - return noFrame, c.handleProtocolError("continuation after final message frame") - } - c.readFinal = final - default: - return noFrame, c.handleProtocolError("unknown opcode " + strconv.Itoa(frameType)) - } - - // 3. Read and parse frame length. - - switch c.readRemaining { - case 126: - p, err := c.read(2) - if err != nil { - return noFrame, err - } - c.readRemaining = int64(binary.BigEndian.Uint16(p)) - case 127: - p, err := c.read(8) - if err != nil { - return noFrame, err - } - c.readRemaining = int64(binary.BigEndian.Uint64(p)) - } - - // 4. Handle frame masking. - - if mask != c.isServer { - return noFrame, c.handleProtocolError("incorrect mask flag") - } - - if mask { - c.readMaskPos = 0 - p, err := c.read(len(c.readMaskKey)) - if err != nil { - return noFrame, err - } - copy(c.readMaskKey[:], p) - } - - // 5. For text and binary messages, enforce read limit and return. - - if frameType == continuationFrame || frameType == TextMessage || frameType == BinaryMessage { - - c.readLength += c.readRemaining - if c.readLimit > 0 && c.readLength > c.readLimit { - c.WriteControl(CloseMessage, FormatCloseMessage(CloseMessageTooBig, ""), time.Now().Add(writeWait)) - return noFrame, ErrReadLimit - } - - return frameType, nil - } - - // 6. Read control frame payload. - - var payload []byte - if c.readRemaining > 0 { - payload, err = c.read(int(c.readRemaining)) - c.readRemaining = 0 - if err != nil { - return noFrame, err - } - if c.isServer { - maskBytes(c.readMaskKey, 0, payload) - } - } - - // 7. Process control frame payload. - - switch frameType { - case PongMessage: - if err := c.handlePong(string(payload)); err != nil { - return noFrame, err - } - case PingMessage: - if err := c.handlePing(string(payload)); err != nil { - return noFrame, err - } - case CloseMessage: - closeCode := CloseNoStatusReceived - closeText := "" - if len(payload) >= 2 { - closeCode = int(binary.BigEndian.Uint16(payload)) - if !isValidReceivedCloseCode(closeCode) { - return noFrame, c.handleProtocolError("invalid close code") - } - closeText = string(payload[2:]) - if !utf8.ValidString(closeText) { - return noFrame, c.handleProtocolError("invalid utf8 payload in close frame") - } - } - if err := c.handleClose(closeCode, closeText); err != nil { - return noFrame, err - } - return noFrame, &CloseError{Code: closeCode, Text: closeText} - } - - return frameType, nil -} - -func (c *Conn) handleProtocolError(message string) error { - c.WriteControl(CloseMessage, FormatCloseMessage(CloseProtocolError, message), time.Now().Add(writeWait)) - return errors.New("websocket: " + message) -} - -// NextReader returns the next data message received from the peer. The -// returned messageType is either TextMessage or BinaryMessage. -// -// There can be at most one open reader on a connection. NextReader discards -// the previous message if the application has not already consumed it. -// -// Applications must break out of the application's read loop when this method -// returns a non-nil error value. Errors returned from this method are -// permanent. Once this method returns a non-nil error, all subsequent calls to -// this method return the same error. -func (c *Conn) NextReader() (messageType int, r io.Reader, err error) { - // Close previous reader, only relevant for decompression. - if c.reader != nil { - c.reader.Close() - c.reader = nil - } - - c.messageReader = nil - c.readLength = 0 - - for c.readErr == nil { - frameType, err := c.advanceFrame() - if err != nil { - c.readErr = hideTempErr(err) - break - } - if frameType == TextMessage || frameType == BinaryMessage { - c.messageReader = &messageReader{c} - c.reader = c.messageReader - if c.readDecompress { - c.reader = c.newDecompressionReader(c.reader) - } - return frameType, c.reader, nil - } - } - - // Applications that do handle the error returned from this method spin in - // tight loop on connection failure. To help application developers detect - // this error, panic on repeated reads to the failed connection. - c.readErrCount++ - if c.readErrCount >= 1000 { - panic("repeated read on failed websocket connection") - } - - return noFrame, nil, c.readErr -} - -type messageReader struct{ c *Conn } - -func (r *messageReader) Read(b []byte) (int, error) { - c := r.c - if c.messageReader != r { - return 0, io.EOF - } - - for c.readErr == nil { - - if c.readRemaining > 0 { - if int64(len(b)) > c.readRemaining { - b = b[:c.readRemaining] - } - n, err := c.br.Read(b) - c.readErr = hideTempErr(err) - if c.isServer { - c.readMaskPos = maskBytes(c.readMaskKey, c.readMaskPos, b[:n]) - } - c.readRemaining -= int64(n) - if c.readRemaining > 0 && c.readErr == io.EOF { - c.readErr = errUnexpectedEOF - } - return n, c.readErr - } - - if c.readFinal { - c.messageReader = nil - return 0, io.EOF - } - - frameType, err := c.advanceFrame() - switch { - case err != nil: - c.readErr = hideTempErr(err) - case frameType == TextMessage || frameType == BinaryMessage: - c.readErr = errors.New("websocket: internal error, unexpected text or binary in Reader") - } - } - - err := c.readErr - if err == io.EOF && c.messageReader == r { - err = errUnexpectedEOF - } - return 0, err -} - -func (r *messageReader) Close() error { - return nil -} - -// ReadMessage is a helper method for getting a reader using NextReader and -// reading from that reader to a buffer. -func (c *Conn) ReadMessage() (messageType int, p []byte, err error) { - var r io.Reader - messageType, r, err = c.NextReader() - if err != nil { - return messageType, nil, err - } - p, err = ioutil.ReadAll(r) - return messageType, p, err -} - -// SetReadDeadline sets the read deadline on the underlying network connection. -// After a read has timed out, the websocket connection state is corrupt and -// all future reads will return an error. A zero value for t means reads will -// not time out. -func (c *Conn) SetReadDeadline(t time.Time) error { - return c.conn.SetReadDeadline(t) -} - -// SetReadLimit sets the maximum size for a message read from the peer. If a -// message exceeds the limit, the connection sends a close frame to the peer -// and returns ErrReadLimit to the application. -func (c *Conn) SetReadLimit(limit int64) { - c.readLimit = limit -} - -// CloseHandler returns the current close handler -func (c *Conn) CloseHandler() func(code int, text string) error { - return c.handleClose -} - -// SetCloseHandler sets the handler for close messages received from the peer. -// The code argument to h is the received close code or CloseNoStatusReceived -// if the close message is empty. The default close handler sends a close frame -// back to the peer. -// -// The application must read the connection to process close messages as -// described in the section on Control Frames above. -// -// The connection read methods return a CloseError when a close frame is -// received. Most applications should handle close messages as part of their -// normal error handling. Applications should only set a close handler when the -// application must perform some action before sending a close frame back to -// the peer. -func (c *Conn) SetCloseHandler(h func(code int, text string) error) { - if h == nil { - h = func(code int, text string) error { - message := []byte{} - if code != CloseNoStatusReceived { - message = FormatCloseMessage(code, "") - } - c.WriteControl(CloseMessage, message, time.Now().Add(writeWait)) - return nil - } - } - c.handleClose = h -} - -// PingHandler returns the current ping handler -func (c *Conn) PingHandler() func(appData string) error { - return c.handlePing -} - -// SetPingHandler sets the handler for ping messages received from the peer. -// The appData argument to h is the PING frame application data. The default -// ping handler sends a pong to the peer. -// -// The application must read the connection to process ping messages as -// described in the section on Control Frames above. -func (c *Conn) SetPingHandler(h func(appData string) error) { - if h == nil { - h = func(message string) error { - err := c.WriteControl(PongMessage, []byte(message), time.Now().Add(writeWait)) - if err == ErrCloseSent { - return nil - } else if e, ok := err.(net.Error); ok && e.Temporary() { - return nil - } - return err - } - } - c.handlePing = h -} - -// PongHandler returns the current pong handler -func (c *Conn) PongHandler() func(appData string) error { - return c.handlePong -} - -// SetPongHandler sets the handler for pong messages received from the peer. -// The appData argument to h is the PONG frame application data. The default -// pong handler does nothing. -// -// The application must read the connection to process ping messages as -// described in the section on Control Frames above. -func (c *Conn) SetPongHandler(h func(appData string) error) { - if h == nil { - h = func(string) error { return nil } - } - c.handlePong = h -} - -// UnderlyingConn returns the internal net.Conn. This can be used to further -// modifications to connection specific flags. -func (c *Conn) UnderlyingConn() net.Conn { - return c.conn -} - -// EnableWriteCompression enables and disables write compression of -// subsequent text and binary messages. This function is a noop if -// compression was not negotiated with the peer. -func (c *Conn) EnableWriteCompression(enable bool) { - c.enableWriteCompression = enable -} - -// SetCompressionLevel sets the flate compression level for subsequent text and -// binary messages. This function is a noop if compression was not negotiated -// with the peer. See the compress/flate package for a description of -// compression levels. -func (c *Conn) SetCompressionLevel(level int) error { - if !isValidCompressionLevel(level) { - return errors.New("websocket: invalid compression level") - } - c.compressionLevel = level - return nil -} - -// FormatCloseMessage formats closeCode and text as a WebSocket close message. -func FormatCloseMessage(closeCode int, text string) []byte { - buf := make([]byte, 2+len(text)) - binary.BigEndian.PutUint16(buf, uint16(closeCode)) - copy(buf[2:], text) - return buf -} diff --git a/vendor/github.com/gorilla/websocket/conn_read.go b/vendor/github.com/gorilla/websocket/conn_read.go deleted file mode 100644 index 1ea1505..0000000 --- a/vendor/github.com/gorilla/websocket/conn_read.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.5 - -package websocket - -import "io" - -func (c *Conn) read(n int) ([]byte, error) { - p, err := c.br.Peek(n) - if err == io.EOF { - err = errUnexpectedEOF - } - c.br.Discard(len(p)) - return p, err -} diff --git a/vendor/github.com/gorilla/websocket/conn_read_legacy.go b/vendor/github.com/gorilla/websocket/conn_read_legacy.go deleted file mode 100644 index 018541c..0000000 --- a/vendor/github.com/gorilla/websocket/conn_read_legacy.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.5 - -package websocket - -import "io" - -func (c *Conn) read(n int) ([]byte, error) { - p, err := c.br.Peek(n) - if err == io.EOF { - err = errUnexpectedEOF - } - if len(p) > 0 { - // advance over the bytes just read - io.ReadFull(c.br, p) - } - return p, err -} diff --git a/vendor/github.com/gorilla/websocket/doc.go b/vendor/github.com/gorilla/websocket/doc.go deleted file mode 100644 index f5ff082..0000000 --- a/vendor/github.com/gorilla/websocket/doc.go +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package websocket implements the WebSocket protocol defined in RFC 6455. -// -// Overview -// -// The Conn type represents a WebSocket connection. A server application calls -// the Upgrader.Upgrade method from an HTTP request handler to get a *Conn: -// -// var upgrader = websocket.Upgrader{ -// ReadBufferSize: 1024, -// WriteBufferSize: 1024, -// } -// -// func handler(w http.ResponseWriter, r *http.Request) { -// conn, err := upgrader.Upgrade(w, r, nil) -// if err != nil { -// log.Println(err) -// return -// } -// ... Use conn to send and receive messages. -// } -// -// Call the connection's WriteMessage and ReadMessage methods to send and -// receive messages as a slice of bytes. This snippet of code shows how to echo -// messages using these methods: -// -// for { -// messageType, p, err := conn.ReadMessage() -// if err != nil { -// return -// } -// if err := conn.WriteMessage(messageType, p); err != nil { -// return err -// } -// } -// -// In above snippet of code, p is a []byte and messageType is an int with value -// websocket.BinaryMessage or websocket.TextMessage. -// -// An application can also send and receive messages using the io.WriteCloser -// and io.Reader interfaces. To send a message, call the connection NextWriter -// method to get an io.WriteCloser, write the message to the writer and close -// the writer when done. To receive a message, call the connection NextReader -// method to get an io.Reader and read until io.EOF is returned. This snippet -// shows how to echo messages using the NextWriter and NextReader methods: -// -// for { -// messageType, r, err := conn.NextReader() -// if err != nil { -// return -// } -// w, err := conn.NextWriter(messageType) -// if err != nil { -// return err -// } -// if _, err := io.Copy(w, r); err != nil { -// return err -// } -// if err := w.Close(); err != nil { -// return err -// } -// } -// -// Data Messages -// -// The WebSocket protocol distinguishes between text and binary data messages. -// Text messages are interpreted as UTF-8 encoded text. The interpretation of -// binary messages is left to the application. -// -// This package uses the TextMessage and BinaryMessage integer constants to -// identify the two data message types. The ReadMessage and NextReader methods -// return the type of the received message. The messageType argument to the -// WriteMessage and NextWriter methods specifies the type of a sent message. -// -// It is the application's responsibility to ensure that text messages are -// valid UTF-8 encoded text. -// -// Control Messages -// -// The WebSocket protocol defines three types of control messages: close, ping -// and pong. Call the connection WriteControl, WriteMessage or NextWriter -// methods to send a control message to the peer. -// -// Connections handle received close messages by sending a close message to the -// peer and returning a *CloseError from the the NextReader, ReadMessage or the -// message Read method. -// -// Connections handle received ping and pong messages by invoking callback -// functions set with SetPingHandler and SetPongHandler methods. The callback -// functions are called from the NextReader, ReadMessage and the message Read -// methods. -// -// The default ping handler sends a pong to the peer. The application's reading -// goroutine can block for a short time while the handler writes the pong data -// to the connection. -// -// The application must read the connection to process ping, pong and close -// messages sent from the peer. If the application is not otherwise interested -// in messages from the peer, then the application should start a goroutine to -// read and discard messages from the peer. A simple example is: -// -// func readLoop(c *websocket.Conn) { -// for { -// if _, _, err := c.NextReader(); err != nil { -// c.Close() -// break -// } -// } -// } -// -// Concurrency -// -// Connections support one concurrent reader and one concurrent writer. -// -// Applications are responsible for ensuring that no more than one goroutine -// calls the write methods (NextWriter, SetWriteDeadline, WriteMessage, -// WriteJSON, EnableWriteCompression, SetCompressionLevel) concurrently and -// that no more than one goroutine calls the read methods (NextReader, -// SetReadDeadline, ReadMessage, ReadJSON, SetPongHandler, SetPingHandler) -// concurrently. -// -// The Close and WriteControl methods can be called concurrently with all other -// methods. -// -// Origin Considerations -// -// Web browsers allow Javascript applications to open a WebSocket connection to -// any host. It's up to the server to enforce an origin policy using the Origin -// request header sent by the browser. -// -// The Upgrader calls the function specified in the CheckOrigin field to check -// the origin. If the CheckOrigin function returns false, then the Upgrade -// method fails the WebSocket handshake with HTTP status 403. -// -// If the CheckOrigin field is nil, then the Upgrader uses a safe default: fail -// the handshake if the Origin request header is present and not equal to the -// Host request header. -// -// An application can allow connections from any origin by specifying a -// function that always returns true: -// -// var upgrader = websocket.Upgrader{ -// CheckOrigin: func(r *http.Request) bool { return true }, -// } -// -// The deprecated package-level Upgrade function does not perform origin -// checking. The application is responsible for checking the Origin header -// before calling the Upgrade function. -// -// Compression EXPERIMENTAL -// -// Per message compression extensions (RFC 7692) are experimentally supported -// by this package in a limited capacity. Setting the EnableCompression option -// to true in Dialer or Upgrader will attempt to negotiate per message deflate -// support. -// -// var upgrader = websocket.Upgrader{ -// EnableCompression: true, -// } -// -// If compression was successfully negotiated with the connection's peer, any -// message received in compressed form will be automatically decompressed. -// All Read methods will return uncompressed bytes. -// -// Per message compression of messages written to a connection can be enabled -// or disabled by calling the corresponding Conn method: -// -// conn.EnableWriteCompression(false) -// -// Currently this package does not support compression with "context takeover". -// This means that messages must be compressed and decompressed in isolation, -// without retaining sliding window or dictionary state across messages. For -// more details refer to RFC 7692. -// -// Use of compression is experimental and may result in decreased performance. -package websocket diff --git a/vendor/github.com/gorilla/websocket/json.go b/vendor/github.com/gorilla/websocket/json.go deleted file mode 100644 index dc2c1f6..0000000 --- a/vendor/github.com/gorilla/websocket/json.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "encoding/json" - "io" -) - -// WriteJSON writes the JSON encoding of v as a message. -// -// Deprecated: Use c.WriteJSON instead. -func WriteJSON(c *Conn, v interface{}) error { - return c.WriteJSON(v) -} - -// WriteJSON writes the JSON encoding of v as a message. -// -// See the documentation for encoding/json Marshal for details about the -// conversion of Go values to JSON. -func (c *Conn) WriteJSON(v interface{}) error { - w, err := c.NextWriter(TextMessage) - if err != nil { - return err - } - err1 := json.NewEncoder(w).Encode(v) - err2 := w.Close() - if err1 != nil { - return err1 - } - return err2 -} - -// ReadJSON reads the next JSON-encoded message from the connection and stores -// it in the value pointed to by v. -// -// Deprecated: Use c.ReadJSON instead. -func ReadJSON(c *Conn, v interface{}) error { - return c.ReadJSON(v) -} - -// ReadJSON reads the next JSON-encoded message from the connection and stores -// it in the value pointed to by v. -// -// See the documentation for the encoding/json Unmarshal function for details -// about the conversion of JSON to a Go value. -func (c *Conn) ReadJSON(v interface{}) error { - _, r, err := c.NextReader() - if err != nil { - return err - } - err = json.NewDecoder(r).Decode(v) - if err == io.EOF { - // One value is expected in the message. - err = io.ErrUnexpectedEOF - } - return err -} diff --git a/vendor/github.com/gorilla/websocket/mask.go b/vendor/github.com/gorilla/websocket/mask.go deleted file mode 100644 index 6a88bbc..0000000 --- a/vendor/github.com/gorilla/websocket/mask.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of -// this source code is governed by a BSD-style license that can be found in the -// LICENSE file. - -// +build !appengine - -package websocket - -import "unsafe" - -const wordSize = int(unsafe.Sizeof(uintptr(0))) - -func maskBytes(key [4]byte, pos int, b []byte) int { - - // Mask one byte at a time for small buffers. - if len(b) < 2*wordSize { - for i := range b { - b[i] ^= key[pos&3] - pos++ - } - return pos & 3 - } - - // Mask one byte at a time to word boundary. - if n := int(uintptr(unsafe.Pointer(&b[0]))) % wordSize; n != 0 { - n = wordSize - n - for i := range b[:n] { - b[i] ^= key[pos&3] - pos++ - } - b = b[n:] - } - - // Create aligned word size key. - var k [wordSize]byte - for i := range k { - k[i] = key[(pos+i)&3] - } - kw := *(*uintptr)(unsafe.Pointer(&k)) - - // Mask one word at a time. - n := (len(b) / wordSize) * wordSize - for i := 0; i < n; i += wordSize { - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&b[0])) + uintptr(i))) ^= kw - } - - // Mask one byte at a time for remaining bytes. - b = b[n:] - for i := range b { - b[i] ^= key[pos&3] - pos++ - } - - return pos & 3 -} diff --git a/vendor/github.com/gorilla/websocket/mask_safe.go b/vendor/github.com/gorilla/websocket/mask_safe.go deleted file mode 100644 index 2aac060..0000000 --- a/vendor/github.com/gorilla/websocket/mask_safe.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of -// this source code is governed by a BSD-style license that can be found in the -// LICENSE file. - -// +build appengine - -package websocket - -func maskBytes(key [4]byte, pos int, b []byte) int { - for i := range b { - b[i] ^= key[pos&3] - pos++ - } - return pos & 3 -} diff --git a/vendor/github.com/gorilla/websocket/prepared.go b/vendor/github.com/gorilla/websocket/prepared.go deleted file mode 100644 index 1efffbd..0000000 --- a/vendor/github.com/gorilla/websocket/prepared.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2017 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bytes" - "net" - "sync" - "time" -) - -// PreparedMessage caches on the wire representations of a message payload. -// Use PreparedMessage to efficiently send a message payload to multiple -// connections. PreparedMessage is especially useful when compression is used -// because the CPU and memory expensive compression operation can be executed -// once for a given set of compression options. -type PreparedMessage struct { - messageType int - data []byte - err error - mu sync.Mutex - frames map[prepareKey]*preparedFrame -} - -// prepareKey defines a unique set of options to cache prepared frames in PreparedMessage. -type prepareKey struct { - isServer bool - compress bool - compressionLevel int -} - -// preparedFrame contains data in wire representation. -type preparedFrame struct { - once sync.Once - data []byte -} - -// NewPreparedMessage returns an initialized PreparedMessage. You can then send -// it to connection using WritePreparedMessage method. Valid wire -// representation will be calculated lazily only once for a set of current -// connection options. -func NewPreparedMessage(messageType int, data []byte) (*PreparedMessage, error) { - pm := &PreparedMessage{ - messageType: messageType, - frames: make(map[prepareKey]*preparedFrame), - data: data, - } - - // Prepare a plain server frame. - _, frameData, err := pm.frame(prepareKey{isServer: true, compress: false}) - if err != nil { - return nil, err - } - - // To protect against caller modifying the data argument, remember the data - // copied to the plain server frame. - pm.data = frameData[len(frameData)-len(data):] - return pm, nil -} - -func (pm *PreparedMessage) frame(key prepareKey) (int, []byte, error) { - pm.mu.Lock() - frame, ok := pm.frames[key] - if !ok { - frame = &preparedFrame{} - pm.frames[key] = frame - } - pm.mu.Unlock() - - var err error - frame.once.Do(func() { - // Prepare a frame using a 'fake' connection. - // TODO: Refactor code in conn.go to allow more direct construction of - // the frame. - mu := make(chan bool, 1) - mu <- true - var nc prepareConn - c := &Conn{ - conn: &nc, - mu: mu, - isServer: key.isServer, - compressionLevel: key.compressionLevel, - enableWriteCompression: true, - writeBuf: make([]byte, defaultWriteBufferSize+maxFrameHeaderSize), - } - if key.compress { - c.newCompressionWriter = compressNoContextTakeover - } - err = c.WriteMessage(pm.messageType, pm.data) - frame.data = nc.buf.Bytes() - }) - return pm.messageType, frame.data, err -} - -type prepareConn struct { - buf bytes.Buffer - net.Conn -} - -func (pc *prepareConn) Write(p []byte) (int, error) { return pc.buf.Write(p) } -func (pc *prepareConn) SetWriteDeadline(t time.Time) error { return nil } diff --git a/vendor/github.com/gorilla/websocket/server.go b/vendor/github.com/gorilla/websocket/server.go deleted file mode 100644 index 6ae97c5..0000000 --- a/vendor/github.com/gorilla/websocket/server.go +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bufio" - "errors" - "net" - "net/http" - "net/url" - "strings" - "time" -) - -// HandshakeError describes an error with the handshake from the peer. -type HandshakeError struct { - message string -} - -func (e HandshakeError) Error() string { return e.message } - -// Upgrader specifies parameters for upgrading an HTTP connection to a -// WebSocket connection. -type Upgrader struct { - // HandshakeTimeout specifies the duration for the handshake to complete. - HandshakeTimeout time.Duration - - // ReadBufferSize and WriteBufferSize specify I/O buffer sizes. If a buffer - // size is zero, then buffers allocated by the HTTP server are used. The - // I/O buffer sizes do not limit the size of the messages that can be sent - // or received. - ReadBufferSize, WriteBufferSize int - - // Subprotocols specifies the server's supported protocols in order of - // preference. If this field is set, then the Upgrade method negotiates a - // subprotocol by selecting the first match in this list with a protocol - // requested by the client. - Subprotocols []string - - // Error specifies the function for generating HTTP error responses. If Error - // is nil, then http.Error is used to generate the HTTP response. - Error func(w http.ResponseWriter, r *http.Request, status int, reason error) - - // CheckOrigin returns true if the request Origin header is acceptable. If - // CheckOrigin is nil, the host in the Origin header must not be set or - // must match the host of the request. - CheckOrigin func(r *http.Request) bool - - // EnableCompression specify if the server should attempt to negotiate per - // message compression (RFC 7692). Setting this value to true does not - // guarantee that compression will be supported. Currently only "no context - // takeover" modes are supported. - EnableCompression bool -} - -func (u *Upgrader) returnError(w http.ResponseWriter, r *http.Request, status int, reason string) (*Conn, error) { - err := HandshakeError{reason} - if u.Error != nil { - u.Error(w, r, status, err) - } else { - w.Header().Set("Sec-Websocket-Version", "13") - http.Error(w, http.StatusText(status), status) - } - return nil, err -} - -// checkSameOrigin returns true if the origin is not set or is equal to the request host. -func checkSameOrigin(r *http.Request) bool { - origin := r.Header["Origin"] - if len(origin) == 0 { - return true - } - u, err := url.Parse(origin[0]) - if err != nil { - return false - } - return u.Host == r.Host -} - -func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header) string { - if u.Subprotocols != nil { - clientProtocols := Subprotocols(r) - for _, serverProtocol := range u.Subprotocols { - for _, clientProtocol := range clientProtocols { - if clientProtocol == serverProtocol { - return clientProtocol - } - } - } - } else if responseHeader != nil { - return responseHeader.Get("Sec-Websocket-Protocol") - } - return "" -} - -// Upgrade upgrades the HTTP server connection to the WebSocket protocol. -// -// The responseHeader is included in the response to the client's upgrade -// request. Use the responseHeader to specify cookies (Set-Cookie) and the -// application negotiated subprotocol (Sec-Websocket-Protocol). -// -// If the upgrade fails, then Upgrade replies to the client with an HTTP error -// response. -func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*Conn, error) { - if r.Method != "GET" { - return u.returnError(w, r, http.StatusMethodNotAllowed, "websocket: not a websocket handshake: request method is not GET") - } - - if _, ok := responseHeader["Sec-Websocket-Extensions"]; ok { - return u.returnError(w, r, http.StatusInternalServerError, "websocket: application specific 'Sec-Websocket-Extensions' headers are unsupported") - } - - if !tokenListContainsValue(r.Header, "Connection", "upgrade") { - return u.returnError(w, r, http.StatusBadRequest, "websocket: not a websocket handshake: 'upgrade' token not found in 'Connection' header") - } - - if !tokenListContainsValue(r.Header, "Upgrade", "websocket") { - return u.returnError(w, r, http.StatusBadRequest, "websocket: not a websocket handshake: 'websocket' token not found in 'Upgrade' header") - } - - if !tokenListContainsValue(r.Header, "Sec-Websocket-Version", "13") { - return u.returnError(w, r, http.StatusBadRequest, "websocket: unsupported version: 13 not found in 'Sec-Websocket-Version' header") - } - - checkOrigin := u.CheckOrigin - if checkOrigin == nil { - checkOrigin = checkSameOrigin - } - if !checkOrigin(r) { - return u.returnError(w, r, http.StatusForbidden, "websocket: 'Origin' header value not allowed") - } - - challengeKey := r.Header.Get("Sec-Websocket-Key") - if challengeKey == "" { - return u.returnError(w, r, http.StatusBadRequest, "websocket: not a websocket handshake: `Sec-Websocket-Key' header is missing or blank") - } - - subprotocol := u.selectSubprotocol(r, responseHeader) - - // Negotiate PMCE - var compress bool - if u.EnableCompression { - for _, ext := range parseExtensions(r.Header) { - if ext[""] != "permessage-deflate" { - continue - } - compress = true - break - } - } - - var ( - netConn net.Conn - err error - ) - - h, ok := w.(http.Hijacker) - if !ok { - return u.returnError(w, r, http.StatusInternalServerError, "websocket: response does not implement http.Hijacker") - } - var brw *bufio.ReadWriter - netConn, brw, err = h.Hijack() - if err != nil { - return u.returnError(w, r, http.StatusInternalServerError, err.Error()) - } - - if brw.Reader.Buffered() > 0 { - netConn.Close() - return nil, errors.New("websocket: client sent data before handshake is complete") - } - - c := newConnBRW(netConn, true, u.ReadBufferSize, u.WriteBufferSize, brw) - c.subprotocol = subprotocol - - if compress { - c.newCompressionWriter = compressNoContextTakeover - c.newDecompressionReader = decompressNoContextTakeover - } - - p := c.writeBuf[:0] - p = append(p, "HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: "...) - p = append(p, computeAcceptKey(challengeKey)...) - p = append(p, "\r\n"...) - if c.subprotocol != "" { - p = append(p, "Sec-Websocket-Protocol: "...) - p = append(p, c.subprotocol...) - p = append(p, "\r\n"...) - } - if compress { - p = append(p, "Sec-Websocket-Extensions: permessage-deflate; server_no_context_takeover; client_no_context_takeover\r\n"...) - } - for k, vs := range responseHeader { - if k == "Sec-Websocket-Protocol" { - continue - } - for _, v := range vs { - p = append(p, k...) - p = append(p, ": "...) - for i := 0; i < len(v); i++ { - b := v[i] - if b <= 31 { - // prevent response splitting. - b = ' ' - } - p = append(p, b) - } - p = append(p, "\r\n"...) - } - } - p = append(p, "\r\n"...) - - // Clear deadlines set by HTTP server. - netConn.SetDeadline(time.Time{}) - - if u.HandshakeTimeout > 0 { - netConn.SetWriteDeadline(time.Now().Add(u.HandshakeTimeout)) - } - if _, err = netConn.Write(p); err != nil { - netConn.Close() - return nil, err - } - if u.HandshakeTimeout > 0 { - netConn.SetWriteDeadline(time.Time{}) - } - - return c, nil -} - -// Upgrade upgrades the HTTP server connection to the WebSocket protocol. -// -// Deprecated: Use websocket.Upgrader instead. -// -// Upgrade does not perform origin checking. The application is responsible for -// checking the Origin header before calling Upgrade. An example implementation -// of the same origin policy check is: -// -// if req.Header.Get("Origin") != "http://"+req.Host { -// http.Error(w, "Origin not allowed", 403) -// return -// } -// -// If the endpoint supports subprotocols, then the application is responsible -// for negotiating the protocol used on the connection. Use the Subprotocols() -// function to get the subprotocols requested by the client. Use the -// Sec-Websocket-Protocol response header to specify the subprotocol selected -// by the application. -// -// The responseHeader is included in the response to the client's upgrade -// request. Use the responseHeader to specify cookies (Set-Cookie) and the -// negotiated subprotocol (Sec-Websocket-Protocol). -// -// The connection buffers IO to the underlying network connection. The -// readBufSize and writeBufSize parameters specify the size of the buffers to -// use. Messages can be larger than the buffers. -// -// If the request is not a valid WebSocket handshake, then Upgrade returns an -// error of type HandshakeError. Applications should handle this error by -// replying to the client with an HTTP error response. -func Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header, readBufSize, writeBufSize int) (*Conn, error) { - u := Upgrader{ReadBufferSize: readBufSize, WriteBufferSize: writeBufSize} - u.Error = func(w http.ResponseWriter, r *http.Request, status int, reason error) { - // don't return errors to maintain backwards compatibility - } - u.CheckOrigin = func(r *http.Request) bool { - // allow all connections by default - return true - } - return u.Upgrade(w, r, responseHeader) -} - -// Subprotocols returns the subprotocols requested by the client in the -// Sec-Websocket-Protocol header. -func Subprotocols(r *http.Request) []string { - h := strings.TrimSpace(r.Header.Get("Sec-Websocket-Protocol")) - if h == "" { - return nil - } - protocols := strings.Split(h, ",") - for i := range protocols { - protocols[i] = strings.TrimSpace(protocols[i]) - } - return protocols -} - -// IsWebSocketUpgrade returns true if the client requested upgrade to the -// WebSocket protocol. -func IsWebSocketUpgrade(r *http.Request) bool { - return tokenListContainsValue(r.Header, "Connection", "upgrade") && - tokenListContainsValue(r.Header, "Upgrade", "websocket") -} diff --git a/vendor/github.com/gorilla/websocket/util.go b/vendor/github.com/gorilla/websocket/util.go deleted file mode 100644 index 262e647..0000000 --- a/vendor/github.com/gorilla/websocket/util.go +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "crypto/rand" - "crypto/sha1" - "encoding/base64" - "io" - "net/http" - "strings" -) - -var keyGUID = []byte("258EAFA5-E914-47DA-95CA-C5AB0DC85B11") - -func computeAcceptKey(challengeKey string) string { - h := sha1.New() - h.Write([]byte(challengeKey)) - h.Write(keyGUID) - return base64.StdEncoding.EncodeToString(h.Sum(nil)) -} - -func generateChallengeKey() (string, error) { - p := make([]byte, 16) - if _, err := io.ReadFull(rand.Reader, p); err != nil { - return "", err - } - return base64.StdEncoding.EncodeToString(p), nil -} - -// Octet types from RFC 2616. -var octetTypes [256]byte - -const ( - isTokenOctet = 1 << iota - isSpaceOctet -) - -func init() { - // From RFC 2616 - // - // OCTET = - // CHAR = - // CTL = - // CR = - // LF = - // SP = - // HT = - // <"> = - // CRLF = CR LF - // LWS = [CRLF] 1*( SP | HT ) - // TEXT = - // separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> - // | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT - // token = 1* - // qdtext = > - - for c := 0; c < 256; c++ { - var t byte - isCtl := c <= 31 || c == 127 - isChar := 0 <= c && c <= 127 - isSeparator := strings.IndexRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) >= 0 - if strings.IndexRune(" \t\r\n", rune(c)) >= 0 { - t |= isSpaceOctet - } - if isChar && !isCtl && !isSeparator { - t |= isTokenOctet - } - octetTypes[c] = t - } -} - -func skipSpace(s string) (rest string) { - i := 0 - for ; i < len(s); i++ { - if octetTypes[s[i]]&isSpaceOctet == 0 { - break - } - } - return s[i:] -} - -func nextToken(s string) (token, rest string) { - i := 0 - for ; i < len(s); i++ { - if octetTypes[s[i]]&isTokenOctet == 0 { - break - } - } - return s[:i], s[i:] -} - -func nextTokenOrQuoted(s string) (value string, rest string) { - if !strings.HasPrefix(s, "\"") { - return nextToken(s) - } - s = s[1:] - for i := 0; i < len(s); i++ { - switch s[i] { - case '"': - return s[:i], s[i+1:] - case '\\': - p := make([]byte, len(s)-1) - j := copy(p, s[:i]) - escape := true - for i = i + 1; i < len(s); i++ { - b := s[i] - switch { - case escape: - escape = false - p[j] = b - j++ - case b == '\\': - escape = true - case b == '"': - return string(p[:j]), s[i+1:] - default: - p[j] = b - j++ - } - } - return "", "" - } - } - return "", "" -} - -// tokenListContainsValue returns true if the 1#token header with the given -// name contains token. -func tokenListContainsValue(header http.Header, name string, value string) bool { -headers: - for _, s := range header[name] { - for { - var t string - t, s = nextToken(skipSpace(s)) - if t == "" { - continue headers - } - s = skipSpace(s) - if s != "" && s[0] != ',' { - continue headers - } - if strings.EqualFold(t, value) { - return true - } - if s == "" { - continue headers - } - s = s[1:] - } - } - return false -} - -// parseExtensiosn parses WebSocket extensions from a header. -func parseExtensions(header http.Header) []map[string]string { - - // From RFC 6455: - // - // Sec-WebSocket-Extensions = extension-list - // extension-list = 1#extension - // extension = extension-token *( ";" extension-param ) - // extension-token = registered-token - // registered-token = token - // extension-param = token [ "=" (token | quoted-string) ] - // ;When using the quoted-string syntax variant, the value - // ;after quoted-string unescaping MUST conform to the - // ;'token' ABNF. - - var result []map[string]string -headers: - for _, s := range header["Sec-Websocket-Extensions"] { - for { - var t string - t, s = nextToken(skipSpace(s)) - if t == "" { - continue headers - } - ext := map[string]string{"": t} - for { - s = skipSpace(s) - if !strings.HasPrefix(s, ";") { - break - } - var k string - k, s = nextToken(skipSpace(s[1:])) - if k == "" { - continue headers - } - s = skipSpace(s) - var v string - if strings.HasPrefix(s, "=") { - v, s = nextTokenOrQuoted(skipSpace(s[1:])) - s = skipSpace(s) - } - if s != "" && s[0] != ',' && s[0] != ';' { - continue headers - } - ext[k] = v - } - if s != "" && s[0] != ',' { - continue headers - } - result = append(result, ext) - if s == "" { - continue headers - } - s = s[1:] - } - } - return result -} diff --git a/vendor/github.com/pkg/errors/LICENSE b/vendor/github.com/pkg/errors/LICENSE deleted file mode 100644 index 835ba3e..0000000 --- a/vendor/github.com/pkg/errors/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2015, Dave Cheney -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/pkg/errors/README.md b/vendor/github.com/pkg/errors/README.md deleted file mode 100644 index 273db3c..0000000 --- a/vendor/github.com/pkg/errors/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/b98mptawhudj53ep/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/errors/branch/master) [![GoDoc](https://godoc.org/github.com/pkg/errors?status.svg)](http://godoc.org/github.com/pkg/errors) [![Report card](https://goreportcard.com/badge/github.com/pkg/errors)](https://goreportcard.com/report/github.com/pkg/errors) - -Package errors provides simple error handling primitives. - -`go get github.com/pkg/errors` - -The traditional error handling idiom in Go is roughly akin to -```go -if err != nil { - return err -} -``` -which applied recursively up the call stack results in error reports without context or debugging information. The errors package allows programmers to add context to the failure path in their code in a way that does not destroy the original value of the error. - -## Adding context to an error - -The errors.Wrap function returns a new error that adds context to the original error. For example -```go -_, err := ioutil.ReadAll(r) -if err != nil { - return errors.Wrap(err, "read failed") -} -``` -## Retrieving the cause of an error - -Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to reverse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`. -```go -type causer interface { - Cause() error -} -``` -`errors.Cause` will recursively retrieve the topmost error which does not implement `causer`, which is assumed to be the original cause. For example: -```go -switch err := errors.Cause(err).(type) { -case *MyError: - // handle specifically -default: - // unknown error -} -``` - -[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors). - -## Contributing - -We welcome pull requests, bug fixes and issue reports. With that said, the bar for adding new symbols to this package is intentionally set high. - -Before proposing a change, please discuss your change by raising an issue. - -## Licence - -BSD-2-Clause diff --git a/vendor/github.com/pkg/errors/appveyor.yml b/vendor/github.com/pkg/errors/appveyor.yml deleted file mode 100644 index a932ead..0000000 --- a/vendor/github.com/pkg/errors/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: build-{build}.{branch} - -clone_folder: C:\gopath\src\github.com\pkg\errors -shallow_clone: true # for startup speed - -environment: - GOPATH: C:\gopath - -platform: - - x64 - -# http://www.appveyor.com/docs/installed-software -install: - # some helpful output for debugging builds - - go version - - go env - # pre-installed MinGW at C:\MinGW is 32bit only - # but MSYS2 at C:\msys64 has mingw64 - - set PATH=C:\msys64\mingw64\bin;%PATH% - - gcc --version - - g++ --version - -build_script: - - go install -v ./... - -test_script: - - set PATH=C:\gopath\bin;%PATH% - - go test -v ./... - -#artifacts: -# - path: '%GOPATH%\bin\*.exe' -deploy: off diff --git a/vendor/github.com/pkg/errors/errors.go b/vendor/github.com/pkg/errors/errors.go deleted file mode 100644 index 842ee80..0000000 --- a/vendor/github.com/pkg/errors/errors.go +++ /dev/null @@ -1,269 +0,0 @@ -// Package errors provides simple error handling primitives. -// -// The traditional error handling idiom in Go is roughly akin to -// -// if err != nil { -// return err -// } -// -// which applied recursively up the call stack results in error reports -// without context or debugging information. The errors package allows -// programmers to add context to the failure path in their code in a way -// that does not destroy the original value of the error. -// -// Adding context to an error -// -// The errors.Wrap function returns a new error that adds context to the -// original error by recording a stack trace at the point Wrap is called, -// and the supplied message. For example -// -// _, err := ioutil.ReadAll(r) -// if err != nil { -// return errors.Wrap(err, "read failed") -// } -// -// If additional control is required the errors.WithStack and errors.WithMessage -// functions destructure errors.Wrap into its component operations of annotating -// an error with a stack trace and an a message, respectively. -// -// Retrieving the cause of an error -// -// Using errors.Wrap constructs a stack of errors, adding context to the -// preceding error. Depending on the nature of the error it may be necessary -// to reverse the operation of errors.Wrap to retrieve the original error -// for inspection. Any error value which implements this interface -// -// type causer interface { -// Cause() error -// } -// -// can be inspected by errors.Cause. errors.Cause will recursively retrieve -// the topmost error which does not implement causer, which is assumed to be -// the original cause. For example: -// -// switch err := errors.Cause(err).(type) { -// case *MyError: -// // handle specifically -// default: -// // unknown error -// } -// -// causer interface is not exported by this package, but is considered a part -// of stable public API. -// -// Formatted printing of errors -// -// All error values returned from this package implement fmt.Formatter and can -// be formatted by the fmt package. The following verbs are supported -// -// %s print the error. If the error has a Cause it will be -// printed recursively -// %v see %s -// %+v extended format. Each Frame of the error's StackTrace will -// be printed in detail. -// -// Retrieving the stack trace of an error or wrapper -// -// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are -// invoked. This information can be retrieved with the following interface. -// -// type stackTracer interface { -// StackTrace() errors.StackTrace -// } -// -// Where errors.StackTrace is defined as -// -// type StackTrace []Frame -// -// The Frame type represents a call site in the stack trace. Frame supports -// the fmt.Formatter interface that can be used for printing information about -// the stack trace of this error. For example: -// -// if err, ok := err.(stackTracer); ok { -// for _, f := range err.StackTrace() { -// fmt.Printf("%+s:%d", f) -// } -// } -// -// stackTracer interface is not exported by this package, but is considered a part -// of stable public API. -// -// See the documentation for Frame.Format for more details. -package errors - -import ( - "fmt" - "io" -) - -// New returns an error with the supplied message. -// New also records the stack trace at the point it was called. -func New(message string) error { - return &fundamental{ - msg: message, - stack: callers(), - } -} - -// Errorf formats according to a format specifier and returns the string -// as a value that satisfies error. -// Errorf also records the stack trace at the point it was called. -func Errorf(format string, args ...interface{}) error { - return &fundamental{ - msg: fmt.Sprintf(format, args...), - stack: callers(), - } -} - -// fundamental is an error that has a message and a stack, but no caller. -type fundamental struct { - msg string - *stack -} - -func (f *fundamental) Error() string { return f.msg } - -func (f *fundamental) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - if s.Flag('+') { - io.WriteString(s, f.msg) - f.stack.Format(s, verb) - return - } - fallthrough - case 's': - io.WriteString(s, f.msg) - case 'q': - fmt.Fprintf(s, "%q", f.msg) - } -} - -// WithStack annotates err with a stack trace at the point WithStack was called. -// If err is nil, WithStack returns nil. -func WithStack(err error) error { - if err == nil { - return nil - } - return &withStack{ - err, - callers(), - } -} - -type withStack struct { - error - *stack -} - -func (w *withStack) Cause() error { return w.error } - -func (w *withStack) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - if s.Flag('+') { - fmt.Fprintf(s, "%+v", w.Cause()) - w.stack.Format(s, verb) - return - } - fallthrough - case 's': - io.WriteString(s, w.Error()) - case 'q': - fmt.Fprintf(s, "%q", w.Error()) - } -} - -// Wrap returns an error annotating err with a stack trace -// at the point Wrap is called, and the supplied message. -// If err is nil, Wrap returns nil. -func Wrap(err error, message string) error { - if err == nil { - return nil - } - err = &withMessage{ - cause: err, - msg: message, - } - return &withStack{ - err, - callers(), - } -} - -// Wrapf returns an error annotating err with a stack trace -// at the point Wrapf is call, and the format specifier. -// If err is nil, Wrapf returns nil. -func Wrapf(err error, format string, args ...interface{}) error { - if err == nil { - return nil - } - err = &withMessage{ - cause: err, - msg: fmt.Sprintf(format, args...), - } - return &withStack{ - err, - callers(), - } -} - -// WithMessage annotates err with a new message. -// If err is nil, WithMessage returns nil. -func WithMessage(err error, message string) error { - if err == nil { - return nil - } - return &withMessage{ - cause: err, - msg: message, - } -} - -type withMessage struct { - cause error - msg string -} - -func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() } -func (w *withMessage) Cause() error { return w.cause } - -func (w *withMessage) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - if s.Flag('+') { - fmt.Fprintf(s, "%+v\n", w.Cause()) - io.WriteString(s, w.msg) - return - } - fallthrough - case 's', 'q': - io.WriteString(s, w.Error()) - } -} - -// Cause returns the underlying cause of the error, if possible. -// An error value has a cause if it implements the following -// interface: -// -// type causer interface { -// Cause() error -// } -// -// If the error does not implement Cause, the original error will -// be returned. If the error is nil, nil will be returned without further -// investigation. -func Cause(err error) error { - type causer interface { - Cause() error - } - - for err != nil { - cause, ok := err.(causer) - if !ok { - break - } - err = cause.Cause() - } - return err -} diff --git a/vendor/github.com/pkg/errors/stack.go b/vendor/github.com/pkg/errors/stack.go deleted file mode 100644 index cbe3f3e..0000000 --- a/vendor/github.com/pkg/errors/stack.go +++ /dev/null @@ -1,186 +0,0 @@ -package errors - -import ( - "fmt" - "io" - "path" - "runtime" - "strings" -) - -// Frame represents a program counter inside a stack frame. -type Frame uintptr - -// pc returns the program counter for this frame; -// multiple frames may have the same PC value. -func (f Frame) pc() uintptr { return uintptr(f) - 1 } - -// file returns the full path to the file that contains the -// function for this Frame's pc. -func (f Frame) file() string { - fn := runtime.FuncForPC(f.pc()) - if fn == nil { - return "unknown" - } - file, _ := fn.FileLine(f.pc()) - return file -} - -// line returns the line number of source code of the -// function for this Frame's pc. -func (f Frame) line() int { - fn := runtime.FuncForPC(f.pc()) - if fn == nil { - return 0 - } - _, line := fn.FileLine(f.pc()) - return line -} - -// Format formats the frame according to the fmt.Formatter interface. -// -// %s source file -// %d source line -// %n function name -// %v equivalent to %s:%d -// -// Format accepts flags that alter the printing of some verbs, as follows: -// -// %+s path of source file relative to the compile time GOPATH -// %+v equivalent to %+s:%d -func (f Frame) Format(s fmt.State, verb rune) { - switch verb { - case 's': - switch { - case s.Flag('+'): - pc := f.pc() - fn := runtime.FuncForPC(pc) - if fn == nil { - io.WriteString(s, "unknown") - } else { - file, _ := fn.FileLine(pc) - fmt.Fprintf(s, "%s\n\t%s", fn.Name(), file) - } - default: - io.WriteString(s, path.Base(f.file())) - } - case 'd': - fmt.Fprintf(s, "%d", f.line()) - case 'n': - name := runtime.FuncForPC(f.pc()).Name() - io.WriteString(s, funcname(name)) - case 'v': - f.Format(s, 's') - io.WriteString(s, ":") - f.Format(s, 'd') - } -} - -// StackTrace is stack of Frames from innermost (newest) to outermost (oldest). -type StackTrace []Frame - -// Format formats the stack of Frames according to the fmt.Formatter interface. -// -// %s lists source files for each Frame in the stack -// %v lists the source file and line number for each Frame in the stack -// -// Format accepts flags that alter the printing of some verbs, as follows: -// -// %+v Prints filename, function, and line number for each Frame in the stack. -func (st StackTrace) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - switch { - case s.Flag('+'): - for _, f := range st { - fmt.Fprintf(s, "\n%+v", f) - } - case s.Flag('#'): - fmt.Fprintf(s, "%#v", []Frame(st)) - default: - fmt.Fprintf(s, "%v", []Frame(st)) - } - case 's': - fmt.Fprintf(s, "%s", []Frame(st)) - } -} - -// stack represents a stack of program counters. -type stack []uintptr - -func (s *stack) Format(st fmt.State, verb rune) { - switch verb { - case 'v': - switch { - case st.Flag('+'): - for _, pc := range *s { - f := Frame(pc) - fmt.Fprintf(st, "\n%+v", f) - } - } - } -} - -func (s *stack) StackTrace() StackTrace { - f := make([]Frame, len(*s)) - for i := 0; i < len(f); i++ { - f[i] = Frame((*s)[i]) - } - return f -} - -func callers() *stack { - const depth = 32 - var pcs [depth]uintptr - n := runtime.Callers(3, pcs[:]) - var st stack = pcs[0:n] - return &st -} - -// funcname removes the path prefix component of a function's name reported by func.Name(). -func funcname(name string) string { - i := strings.LastIndex(name, "/") - name = name[i+1:] - i = strings.Index(name, ".") - return name[i+1:] -} - -func trimGOPATH(name, file string) string { - // Here we want to get the source file path relative to the compile time - // GOPATH. As of Go 1.6.x there is no direct way to know the compiled - // GOPATH at runtime, but we can infer the number of path segments in the - // GOPATH. We note that fn.Name() returns the function name qualified by - // the import path, which does not include the GOPATH. Thus we can trim - // segments from the beginning of the file path until the number of path - // separators remaining is one more than the number of path separators in - // the function name. For example, given: - // - // GOPATH /home/user - // file /home/user/src/pkg/sub/file.go - // fn.Name() pkg/sub.Type.Method - // - // We want to produce: - // - // pkg/sub/file.go - // - // From this we can easily see that fn.Name() has one less path separator - // than our desired output. We count separators from the end of the file - // path until it finds two more than in the function name and then move - // one character forward to preserve the initial path segment without a - // leading separator. - const sep = "/" - goal := strings.Count(name, sep) + 2 - i := len(file) - for n := 0; n < goal; n++ { - i = strings.LastIndex(file[:i], sep) - if i == -1 { - // not enough separators found, set i so that the slice expression - // below leaves file unmodified - i = -len(sep) - break - } - } - // get back to 0 or trim the leading separator - file = file[i+len(sep):] - return file -} diff --git a/vendor/github.com/rancher/go-rancher/LICENSE b/vendor/github.com/rancher/go-rancher/LICENSE deleted file mode 100644 index f433b1a..0000000 --- a/vendor/github.com/rancher/go-rancher/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - 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 diff --git a/vendor/github.com/rancher/go-rancher/v2/client.go b/vendor/github.com/rancher/go-rancher/v2/client.go deleted file mode 100644 index fef9e40..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/client.go +++ /dev/null @@ -1,39 +0,0 @@ -package client - -import ( - "net/http" - - "github.com/gorilla/websocket" -) - -type RancherBaseClientImpl struct { - Opts *ClientOpts - Schemas *Schemas - Types map[string]Schema -} - -type RancherBaseClient interface { - Websocket(string, map[string][]string) (*websocket.Conn, *http.Response, error) - List(string, *ListOpts, interface{}) error - Post(string, interface{}, interface{}) error - GetLink(Resource, string, interface{}) error - Create(string, interface{}, interface{}) error - Update(string, *Resource, interface{}, interface{}) error - ById(string, string, interface{}) error - Delete(*Resource) error - Reload(*Resource, interface{}) error - Action(string, string, *Resource, interface{}, interface{}) error - GetOpts() *ClientOpts - GetSchemas() *Schemas - GetTypes() map[string]Schema - - doGet(string, *ListOpts, interface{}) error - doList(string, *ListOpts, interface{}) error - doNext(string, interface{}) error - doModify(string, string, interface{}, interface{}) error - doCreate(string, interface{}, interface{}) error - doUpdate(string, *Resource, interface{}, interface{}) error - doById(string, string, interface{}) error - doResourceDelete(string, *Resource) error - doAction(string, string, *Resource, interface{}, interface{}) error -} diff --git a/vendor/github.com/rancher/go-rancher/v2/common.go b/vendor/github.com/rancher/go-rancher/v2/common.go deleted file mode 100644 index 9770165..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/common.go +++ /dev/null @@ -1,620 +0,0 @@ -package client - -import ( - "bytes" - "encoding/base64" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "os" - "regexp" - "strings" - "time" - - "github.com/gorilla/websocket" - "github.com/pkg/errors" -) - -const ( - SELF = "self" - COLLECTION = "collection" -) - -var ( - debug = false - dialer = &websocket.Dialer{} - privateFieldRegex = regexp.MustCompile("^[[:lower:]]") -) - -type ClientOpts struct { - Url string - AccessKey string - SecretKey string - Timeout time.Duration -} - -type ApiError struct { - StatusCode int - Url string - Msg string - Status string - Body string -} - -func (e *ApiError) Error() string { - return e.Msg -} - -func IsNotFound(err error) bool { - apiError, ok := err.(*ApiError) - if !ok { - return false - } - - return apiError.StatusCode == http.StatusNotFound -} - -func newApiError(resp *http.Response, url string) *ApiError { - contents, err := ioutil.ReadAll(resp.Body) - var body string - if err != nil { - body = "Unreadable body." - } else { - body = string(contents) - } - - data := map[string]interface{}{} - if json.Unmarshal(contents, &data) == nil { - delete(data, "id") - delete(data, "links") - delete(data, "actions") - delete(data, "type") - delete(data, "status") - buf := &bytes.Buffer{} - for k, v := range data { - if v == nil { - continue - } - if buf.Len() > 0 { - buf.WriteString(", ") - } - fmt.Fprintf(buf, "%s=%v", k, v) - } - body = buf.String() - } - formattedMsg := fmt.Sprintf("Bad response statusCode [%d]. Status [%s]. Body: [%s] from [%s]", - resp.StatusCode, resp.Status, body, url) - return &ApiError{ - Url: url, - Msg: formattedMsg, - StatusCode: resp.StatusCode, - Status: resp.Status, - Body: body, - } -} - -func contains(array []string, item string) bool { - for _, check := range array { - if check == item { - return true - } - } - - return false -} - -func appendFilters(urlString string, filters map[string]interface{}) (string, error) { - if len(filters) == 0 { - return urlString, nil - } - - u, err := url.Parse(urlString) - if err != nil { - return "", err - } - - q := u.Query() - for k, v := range filters { - if l, ok := v.([]string); ok { - for _, v := range l { - q.Add(k, v) - } - } else { - q.Add(k, fmt.Sprintf("%v", v)) - } - } - - u.RawQuery = q.Encode() - return u.String(), nil -} - -func NormalizeUrl(existingUrl string) (string, error) { - u, err := url.Parse(existingUrl) - if err != nil { - return "", err - } - - if u.Path == "" || u.Path == "/" { - u.Path = "v2-beta" - } else if u.Path == "/v1" || strings.HasPrefix(u.Path, "/v1/") { - u.Path = strings.Replace(u.Path, "/v1", "/v2-beta", 1) - } - - return u.String(), nil -} - -func setupRancherBaseClient(rancherClient *RancherBaseClientImpl, opts *ClientOpts) error { - var err error - opts.Url, err = NormalizeUrl(opts.Url) - if err != nil { - return err - } - - if opts.Timeout == 0 { - opts.Timeout = time.Second * 10 - } - client := &http.Client{Timeout: opts.Timeout} - req, err := http.NewRequest("GET", opts.Url, nil) - if err != nil { - return err - } - - req.SetBasicAuth(opts.AccessKey, opts.SecretKey) - - resp, err := client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode != 200 { - return newApiError(resp, opts.Url) - } - - schemasUrls := resp.Header.Get("X-API-Schemas") - if len(schemasUrls) == 0 { - return errors.New("Failed to find schema at [" + opts.Url + "]") - } - - if schemasUrls != opts.Url { - req, err = http.NewRequest("GET", schemasUrls, nil) - req.SetBasicAuth(opts.AccessKey, opts.SecretKey) - if err != nil { - return err - } - - resp, err = client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode != 200 { - return newApiError(resp, opts.Url) - } - } - - var schemas Schemas - bytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - return err - } - - err = json.Unmarshal(bytes, &schemas) - if err != nil { - return err - } - - rancherClient.Opts = opts - rancherClient.Schemas = &schemas - - for _, schema := range schemas.Data { - rancherClient.Types[schema.Id] = schema - } - - return nil -} - -func NewListOpts() *ListOpts { - return &ListOpts{ - Filters: map[string]interface{}{}, - } -} - -func (rancherClient *RancherBaseClientImpl) setupRequest(req *http.Request) { - req.SetBasicAuth(rancherClient.Opts.AccessKey, rancherClient.Opts.SecretKey) -} - -func (rancherClient *RancherBaseClientImpl) newHttpClient() *http.Client { - if rancherClient.Opts.Timeout == 0 { - rancherClient.Opts.Timeout = time.Second * 10 - } - return &http.Client{Timeout: rancherClient.Opts.Timeout} -} - -func (rancherClient *RancherBaseClientImpl) doDelete(url string) error { - client := rancherClient.newHttpClient() - req, err := http.NewRequest("DELETE", url, nil) - if err != nil { - return err - } - - rancherClient.setupRequest(req) - - resp, err := client.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - - io.Copy(ioutil.Discard, resp.Body) - - if resp.StatusCode >= 300 { - return newApiError(resp, url) - } - - return nil -} - -func (rancherClient *RancherBaseClientImpl) Websocket(url string, headers map[string][]string) (*websocket.Conn, *http.Response, error) { - httpHeaders := http.Header{} - for k, v := range httpHeaders { - httpHeaders[k] = v - } - - if rancherClient.Opts != nil { - s := rancherClient.Opts.AccessKey + ":" + rancherClient.Opts.SecretKey - httpHeaders.Add("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(s))) - } - - return dialer.Dial(url, http.Header(httpHeaders)) -} - -func (rancherClient *RancherBaseClientImpl) doGet(url string, opts *ListOpts, respObject interface{}) error { - if opts == nil { - opts = NewListOpts() - } - url, err := appendFilters(url, opts.Filters) - if err != nil { - return err - } - - if debug { - fmt.Println("GET " + url) - } - - client := rancherClient.newHttpClient() - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return err - } - - rancherClient.setupRequest(req) - - resp, err := client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode != 200 { - return newApiError(resp, url) - } - - byteContent, err := ioutil.ReadAll(resp.Body) - if err != nil { - return err - } - - if debug { - fmt.Println("Response <= " + string(byteContent)) - } - - if err := json.Unmarshal(byteContent, respObject); err != nil { - return errors.Wrap(err, fmt.Sprintf("Failed to parse: %s", byteContent)) - } - - return nil -} - -func (rancherClient *RancherBaseClientImpl) List(schemaType string, opts *ListOpts, respObject interface{}) error { - return rancherClient.doList(schemaType, opts, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doList(schemaType string, opts *ListOpts, respObject interface{}) error { - schema, ok := rancherClient.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.CollectionMethods, "GET") { - return errors.New("Resource type [" + schemaType + "] is not listable") - } - - collectionUrl, ok := schema.Links[COLLECTION] - if !ok { - return errors.New("Failed to find collection URL for [" + schemaType + "]") - } - - return rancherClient.doGet(collectionUrl, opts, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doNext(nextUrl string, respObject interface{}) error { - return rancherClient.doGet(nextUrl, nil, respObject) -} - -func (rancherClient *RancherBaseClientImpl) Post(url string, createObj interface{}, respObject interface{}) error { - return rancherClient.doModify("POST", url, createObj, respObject) -} - -func (rancherClient *RancherBaseClientImpl) GetLink(resource Resource, link string, respObject interface{}) error { - url := resource.Links[link] - if url == "" { - return fmt.Errorf("Failed to find link: %s", link) - } - - return rancherClient.doGet(url, &ListOpts{}, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doModify(method string, url string, createObj interface{}, respObject interface{}) error { - bodyContent, err := json.Marshal(createObj) - if err != nil { - return err - } - - if debug { - fmt.Println(method + " " + url) - fmt.Println("Request => " + string(bodyContent)) - } - - client := rancherClient.newHttpClient() - req, err := http.NewRequest(method, url, bytes.NewBuffer(bodyContent)) - if err != nil { - return err - } - - rancherClient.setupRequest(req) - req.Header.Set("Content-Type", "application/json") - - resp, err := client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode >= 300 { - return newApiError(resp, url) - } - - byteContent, err := ioutil.ReadAll(resp.Body) - if err != nil { - return err - } - - if len(byteContent) > 0 { - if debug { - fmt.Println("Response <= " + string(byteContent)) - } - return json.Unmarshal(byteContent, respObject) - } - - return nil -} - -func (rancherClient *RancherBaseClientImpl) Create(schemaType string, createObj interface{}, respObject interface{}) error { - return rancherClient.doCreate(schemaType, createObj, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doCreate(schemaType string, createObj interface{}, respObject interface{}) error { - if createObj == nil { - createObj = map[string]string{} - } - if respObject == nil { - respObject = &map[string]interface{}{} - } - schema, ok := rancherClient.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.CollectionMethods, "POST") { - return errors.New("Resource type [" + schemaType + "] is not creatable") - } - - var collectionUrl string - collectionUrl, ok = schema.Links[COLLECTION] - if !ok { - // return errors.New("Failed to find collection URL for [" + schemaType + "]") - // This is a hack to address https://github.com/rancher/cattle/issues/254 - re := regexp.MustCompile("schemas.*") - collectionUrl = re.ReplaceAllString(schema.Links[SELF], schema.PluralName) - } - - return rancherClient.doModify("POST", collectionUrl, createObj, respObject) -} - -func (rancherClient *RancherBaseClientImpl) Update(schemaType string, existing *Resource, updates interface{}, respObject interface{}) error { - return rancherClient.doUpdate(schemaType, existing, updates, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doUpdate(schemaType string, existing *Resource, updates interface{}, respObject interface{}) error { - if existing == nil { - return errors.New("Existing object is nil") - } - - selfUrl, ok := existing.Links[SELF] - if !ok { - return errors.New(fmt.Sprintf("Failed to find self URL of [%v]", existing)) - } - - if updates == nil { - updates = map[string]string{} - } - - if respObject == nil { - respObject = &map[string]interface{}{} - } - - schema, ok := rancherClient.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.ResourceMethods, "PUT") { - return errors.New("Resource type [" + schemaType + "] is not updatable") - } - - return rancherClient.doModify("PUT", selfUrl, updates, respObject) -} - -func (rancherClient *RancherBaseClientImpl) ById(schemaType string, id string, respObject interface{}) error { - return rancherClient.doById(schemaType, id, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doById(schemaType string, id string, respObject interface{}) error { - schema, ok := rancherClient.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.ResourceMethods, "GET") { - return errors.New("Resource type [" + schemaType + "] can not be looked up by ID") - } - - collectionUrl, ok := schema.Links[COLLECTION] - if !ok { - return errors.New("Failed to find collection URL for [" + schemaType + "]") - } - - err := rancherClient.doGet(collectionUrl+"/"+id, nil, respObject) - //TODO check for 404 and return nil, nil - return err -} - -func (rancherClient *RancherBaseClientImpl) Delete(existing *Resource) error { - if existing == nil { - return nil - } - return rancherClient.doResourceDelete(existing.Type, existing) -} - -func (rancherClient *RancherBaseClientImpl) doResourceDelete(schemaType string, existing *Resource) error { - schema, ok := rancherClient.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.ResourceMethods, "DELETE") { - return errors.New("Resource type [" + schemaType + "] can not be deleted") - } - - selfUrl, ok := existing.Links[SELF] - if !ok { - return errors.New(fmt.Sprintf("Failed to find self URL of [%v]", existing)) - } - - return rancherClient.doDelete(selfUrl) -} - -func (rancherClient *RancherBaseClientImpl) Reload(existing *Resource, output interface{}) error { - selfUrl, ok := existing.Links[SELF] - if !ok { - return errors.New(fmt.Sprintf("Failed to find self URL of [%v]", existing)) - } - - return rancherClient.doGet(selfUrl, NewListOpts(), output) -} - -func (rancherClient *RancherBaseClientImpl) Action(schemaType string, action string, - existing *Resource, inputObject, respObject interface{}) error { - return rancherClient.doAction(schemaType, action, existing, inputObject, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doAction(schemaType string, action string, - existing *Resource, inputObject, respObject interface{}) error { - - if existing == nil { - return errors.New("Existing object is nil") - } - - actionUrl, ok := existing.Actions[action] - if !ok { - return errors.New(fmt.Sprintf("Action [%v] not available on [%v]", action, existing)) - } - - _, ok = rancherClient.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - var input io.Reader - - if inputObject != nil { - bodyContent, err := json.Marshal(inputObject) - if err != nil { - return err - } - if debug { - fmt.Println("Request => " + string(bodyContent)) - } - input = bytes.NewBuffer(bodyContent) - } - - client := rancherClient.newHttpClient() - req, err := http.NewRequest("POST", actionUrl, input) - if err != nil { - return err - } - - rancherClient.setupRequest(req) - req.Header.Set("Content-Type", "application/json") - req.Header.Set("Content-Length", "0") - - resp, err := client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode >= 300 { - return newApiError(resp, actionUrl) - } - - byteContent, err := ioutil.ReadAll(resp.Body) - if err != nil { - return err - } - - if debug { - fmt.Println("Response <= " + string(byteContent)) - } - - return json.Unmarshal(byteContent, respObject) -} - -func (rancherClient *RancherBaseClientImpl) GetOpts() *ClientOpts { - return rancherClient.Opts -} - -func (rancherClient *RancherBaseClientImpl) GetSchemas() *Schemas { - return rancherClient.Schemas -} - -func (rancherClient *RancherBaseClientImpl) GetTypes() map[string]Schema { - return rancherClient.Types -} - -func init() { - debug = os.Getenv("RANCHER_CLIENT_DEBUG") == "true" - if debug { - fmt.Println("Rancher client debug on") - } -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_account.go b/vendor/github.com/rancher/go-rancher/v2/generated_account.go deleted file mode 100644 index c4b86be..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_account.go +++ /dev/null @@ -1,186 +0,0 @@ -package client - -const ( - ACCOUNT_TYPE = "account" -) - -type Account struct { - Resource - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExternalIdType string `json:"externalIdType,omitempty" yaml:"external_id_type,omitempty"` - - Identity string `json:"identity,omitempty" yaml:"identity,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` -} - -type AccountCollection struct { - Collection - Data []Account `json:"data,omitempty"` - client *AccountClient -} - -type AccountClient struct { - rancherClient *RancherClient -} - -type AccountOperations interface { - List(opts *ListOpts) (*AccountCollection, error) - Create(opts *Account) (*Account, error) - Update(existing *Account, updates interface{}) (*Account, error) - ById(id string) (*Account, error) - Delete(container *Account) error - - ActionActivate(*Account) (*Account, error) - - ActionCreate(*Account) (*Account, error) - - ActionDeactivate(*Account) (*Account, error) - - ActionPurge(*Account) (*Account, error) - - ActionRemove(*Account) (*Account, error) - - ActionUpdate(*Account) (*Account, error) - - ActionUpgrade(*Account) (*Account, error) -} - -func newAccountClient(rancherClient *RancherClient) *AccountClient { - return &AccountClient{ - rancherClient: rancherClient, - } -} - -func (c *AccountClient) Create(container *Account) (*Account, error) { - resp := &Account{} - err := c.rancherClient.doCreate(ACCOUNT_TYPE, container, resp) - return resp, err -} - -func (c *AccountClient) Update(existing *Account, updates interface{}) (*Account, error) { - resp := &Account{} - err := c.rancherClient.doUpdate(ACCOUNT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AccountClient) List(opts *ListOpts) (*AccountCollection, error) { - resp := &AccountCollection{} - err := c.rancherClient.doList(ACCOUNT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AccountCollection) Next() (*AccountCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AccountCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AccountClient) ById(id string) (*Account, error) { - resp := &Account{} - err := c.rancherClient.doById(ACCOUNT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AccountClient) Delete(container *Account) error { - return c.rancherClient.doResourceDelete(ACCOUNT_TYPE, &container.Resource) -} - -func (c *AccountClient) ActionActivate(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AccountClient) ActionCreate(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AccountClient) ActionDeactivate(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AccountClient) ActionPurge(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AccountClient) ActionRemove(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AccountClient) ActionUpdate(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AccountClient) ActionUpgrade(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "upgrade", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go b/vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go deleted file mode 100644 index b1799a3..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - ACTIVE_SETTING_TYPE = "activeSetting" -) - -type ActiveSetting struct { - Resource - - ActiveValue interface{} `json:"activeValue,omitempty" yaml:"active_value,omitempty"` - - InDb bool `json:"inDb,omitempty" yaml:"in_db,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Source string `json:"source,omitempty" yaml:"source,omitempty"` - - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} - -type ActiveSettingCollection struct { - Collection - Data []ActiveSetting `json:"data,omitempty"` - client *ActiveSettingClient -} - -type ActiveSettingClient struct { - rancherClient *RancherClient -} - -type ActiveSettingOperations interface { - List(opts *ListOpts) (*ActiveSettingCollection, error) - Create(opts *ActiveSetting) (*ActiveSetting, error) - Update(existing *ActiveSetting, updates interface{}) (*ActiveSetting, error) - ById(id string) (*ActiveSetting, error) - Delete(container *ActiveSetting) error -} - -func newActiveSettingClient(rancherClient *RancherClient) *ActiveSettingClient { - return &ActiveSettingClient{ - rancherClient: rancherClient, - } -} - -func (c *ActiveSettingClient) Create(container *ActiveSetting) (*ActiveSetting, error) { - resp := &ActiveSetting{} - err := c.rancherClient.doCreate(ACTIVE_SETTING_TYPE, container, resp) - return resp, err -} - -func (c *ActiveSettingClient) Update(existing *ActiveSetting, updates interface{}) (*ActiveSetting, error) { - resp := &ActiveSetting{} - err := c.rancherClient.doUpdate(ACTIVE_SETTING_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ActiveSettingClient) List(opts *ListOpts) (*ActiveSettingCollection, error) { - resp := &ActiveSettingCollection{} - err := c.rancherClient.doList(ACTIVE_SETTING_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ActiveSettingCollection) Next() (*ActiveSettingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ActiveSettingCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ActiveSettingClient) ById(id string) (*ActiveSetting, error) { - resp := &ActiveSetting{} - err := c.rancherClient.doById(ACTIVE_SETTING_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ActiveSettingClient) Delete(container *ActiveSetting) error { - return c.rancherClient.doResourceDelete(ACTIVE_SETTING_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go deleted file mode 100644 index 88bf4a7..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - ADD_OUTPUTS_INPUT_TYPE = "addOutputsInput" -) - -type AddOutputsInput struct { - Resource - - Outputs map[string]interface{} `json:"outputs,omitempty" yaml:"outputs,omitempty"` -} - -type AddOutputsInputCollection struct { - Collection - Data []AddOutputsInput `json:"data,omitempty"` - client *AddOutputsInputClient -} - -type AddOutputsInputClient struct { - rancherClient *RancherClient -} - -type AddOutputsInputOperations interface { - List(opts *ListOpts) (*AddOutputsInputCollection, error) - Create(opts *AddOutputsInput) (*AddOutputsInput, error) - Update(existing *AddOutputsInput, updates interface{}) (*AddOutputsInput, error) - ById(id string) (*AddOutputsInput, error) - Delete(container *AddOutputsInput) error -} - -func newAddOutputsInputClient(rancherClient *RancherClient) *AddOutputsInputClient { - return &AddOutputsInputClient{ - rancherClient: rancherClient, - } -} - -func (c *AddOutputsInputClient) Create(container *AddOutputsInput) (*AddOutputsInput, error) { - resp := &AddOutputsInput{} - err := c.rancherClient.doCreate(ADD_OUTPUTS_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *AddOutputsInputClient) Update(existing *AddOutputsInput, updates interface{}) (*AddOutputsInput, error) { - resp := &AddOutputsInput{} - err := c.rancherClient.doUpdate(ADD_OUTPUTS_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AddOutputsInputClient) List(opts *ListOpts) (*AddOutputsInputCollection, error) { - resp := &AddOutputsInputCollection{} - err := c.rancherClient.doList(ADD_OUTPUTS_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AddOutputsInputCollection) Next() (*AddOutputsInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AddOutputsInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AddOutputsInputClient) ById(id string) (*AddOutputsInput, error) { - resp := &AddOutputsInput{} - err := c.rancherClient.doById(ADD_OUTPUTS_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AddOutputsInputClient) Delete(container *AddOutputsInput) error { - return c.rancherClient.doResourceDelete(ADD_OUTPUTS_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go deleted file mode 100644 index 5366b48..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - ADD_REMOVE_SERVICE_LINK_INPUT_TYPE = "addRemoveServiceLinkInput" -) - -type AddRemoveServiceLinkInput struct { - Resource - - ServiceLink ServiceLink `json:"serviceLink,omitempty" yaml:"service_link,omitempty"` -} - -type AddRemoveServiceLinkInputCollection struct { - Collection - Data []AddRemoveServiceLinkInput `json:"data,omitempty"` - client *AddRemoveServiceLinkInputClient -} - -type AddRemoveServiceLinkInputClient struct { - rancherClient *RancherClient -} - -type AddRemoveServiceLinkInputOperations interface { - List(opts *ListOpts) (*AddRemoveServiceLinkInputCollection, error) - Create(opts *AddRemoveServiceLinkInput) (*AddRemoveServiceLinkInput, error) - Update(existing *AddRemoveServiceLinkInput, updates interface{}) (*AddRemoveServiceLinkInput, error) - ById(id string) (*AddRemoveServiceLinkInput, error) - Delete(container *AddRemoveServiceLinkInput) error -} - -func newAddRemoveServiceLinkInputClient(rancherClient *RancherClient) *AddRemoveServiceLinkInputClient { - return &AddRemoveServiceLinkInputClient{ - rancherClient: rancherClient, - } -} - -func (c *AddRemoveServiceLinkInputClient) Create(container *AddRemoveServiceLinkInput) (*AddRemoveServiceLinkInput, error) { - resp := &AddRemoveServiceLinkInput{} - err := c.rancherClient.doCreate(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *AddRemoveServiceLinkInputClient) Update(existing *AddRemoveServiceLinkInput, updates interface{}) (*AddRemoveServiceLinkInput, error) { - resp := &AddRemoveServiceLinkInput{} - err := c.rancherClient.doUpdate(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AddRemoveServiceLinkInputClient) List(opts *ListOpts) (*AddRemoveServiceLinkInputCollection, error) { - resp := &AddRemoveServiceLinkInputCollection{} - err := c.rancherClient.doList(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AddRemoveServiceLinkInputCollection) Next() (*AddRemoveServiceLinkInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AddRemoveServiceLinkInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AddRemoveServiceLinkInputClient) ById(id string) (*AddRemoveServiceLinkInput, error) { - resp := &AddRemoveServiceLinkInput{} - err := c.rancherClient.doById(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AddRemoveServiceLinkInputClient) Delete(container *AddRemoveServiceLinkInput) error { - return c.rancherClient.doResourceDelete(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_agent.go b/vendor/github.com/rancher/go-rancher/v2/generated_agent.go deleted file mode 100644 index d384631..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_agent.go +++ /dev/null @@ -1,206 +0,0 @@ -package client - -const ( - AGENT_TYPE = "agent" -) - -type Agent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ManagedConfig bool `json:"managedConfig,omitempty" yaml:"managed_config,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type AgentCollection struct { - Collection - Data []Agent `json:"data,omitempty"` - client *AgentClient -} - -type AgentClient struct { - rancherClient *RancherClient -} - -type AgentOperations interface { - List(opts *ListOpts) (*AgentCollection, error) - Create(opts *Agent) (*Agent, error) - Update(existing *Agent, updates interface{}) (*Agent, error) - ById(id string) (*Agent, error) - Delete(container *Agent) error - - ActionActivate(*Agent) (*Agent, error) - - ActionCreate(*Agent) (*Agent, error) - - ActionDeactivate(*Agent) (*Agent, error) - - ActionDisconnect(*Agent) (*Agent, error) - - ActionFinishreconnect(*Agent) (*Agent, error) - - ActionPurge(*Agent) (*Agent, error) - - ActionReconnect(*Agent) (*Agent, error) - - ActionRemove(*Agent) (*Agent, error) - - ActionUpdate(*Agent) (*Agent, error) -} - -func newAgentClient(rancherClient *RancherClient) *AgentClient { - return &AgentClient{ - rancherClient: rancherClient, - } -} - -func (c *AgentClient) Create(container *Agent) (*Agent, error) { - resp := &Agent{} - err := c.rancherClient.doCreate(AGENT_TYPE, container, resp) - return resp, err -} - -func (c *AgentClient) Update(existing *Agent, updates interface{}) (*Agent, error) { - resp := &Agent{} - err := c.rancherClient.doUpdate(AGENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AgentClient) List(opts *ListOpts) (*AgentCollection, error) { - resp := &AgentCollection{} - err := c.rancherClient.doList(AGENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AgentCollection) Next() (*AgentCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AgentCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AgentClient) ById(id string) (*Agent, error) { - resp := &Agent{} - err := c.rancherClient.doById(AGENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AgentClient) Delete(container *Agent) error { - return c.rancherClient.doResourceDelete(AGENT_TYPE, &container.Resource) -} - -func (c *AgentClient) ActionActivate(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionCreate(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionDeactivate(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionDisconnect(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "disconnect", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionFinishreconnect(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "finishreconnect", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionPurge(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionReconnect(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "reconnect", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionRemove(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionUpdate(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go b/vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go deleted file mode 100644 index d753595..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go +++ /dev/null @@ -1,137 +0,0 @@ -package client - -const ( - AMAZONEC2CONFIG_TYPE = "amazonec2Config" -) - -type Amazonec2Config struct { - Resource - - AccessKey string `json:"accessKey,omitempty" yaml:"access_key,omitempty"` - - Ami string `json:"ami,omitempty" yaml:"ami,omitempty"` - - BlockDurationMinutes string `json:"blockDurationMinutes,omitempty" yaml:"block_duration_minutes,omitempty"` - - DeviceName string `json:"deviceName,omitempty" yaml:"device_name,omitempty"` - - Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` - - IamInstanceProfile string `json:"iamInstanceProfile,omitempty" yaml:"iam_instance_profile,omitempty"` - - InsecureTransport bool `json:"insecureTransport,omitempty" yaml:"insecure_transport,omitempty"` - - InstanceType string `json:"instanceType,omitempty" yaml:"instance_type,omitempty"` - - KeypairName string `json:"keypairName,omitempty" yaml:"keypair_name,omitempty"` - - Monitoring bool `json:"monitoring,omitempty" yaml:"monitoring,omitempty"` - - OpenPort []string `json:"openPort,omitempty" yaml:"open_port,omitempty"` - - PrivateAddressOnly bool `json:"privateAddressOnly,omitempty" yaml:"private_address_only,omitempty"` - - Region string `json:"region,omitempty" yaml:"region,omitempty"` - - RequestSpotInstance bool `json:"requestSpotInstance,omitempty" yaml:"request_spot_instance,omitempty"` - - Retries string `json:"retries,omitempty" yaml:"retries,omitempty"` - - RootSize string `json:"rootSize,omitempty" yaml:"root_size,omitempty"` - - SecretKey string `json:"secretKey,omitempty" yaml:"secret_key,omitempty"` - - SecurityGroup []string `json:"securityGroup,omitempty" yaml:"security_group,omitempty"` - - SessionToken string `json:"sessionToken,omitempty" yaml:"session_token,omitempty"` - - SpotPrice string `json:"spotPrice,omitempty" yaml:"spot_price,omitempty"` - - SshKeypath string `json:"sshKeypath,omitempty" yaml:"ssh_keypath,omitempty"` - - SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` - - SubnetId string `json:"subnetId,omitempty" yaml:"subnet_id,omitempty"` - - Tags string `json:"tags,omitempty" yaml:"tags,omitempty"` - - UseEbsOptimizedInstance bool `json:"useEbsOptimizedInstance,omitempty" yaml:"use_ebs_optimized_instance,omitempty"` - - UsePrivateAddress bool `json:"usePrivateAddress,omitempty" yaml:"use_private_address,omitempty"` - - Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` - - VolumeType string `json:"volumeType,omitempty" yaml:"volume_type,omitempty"` - - VpcId string `json:"vpcId,omitempty" yaml:"vpc_id,omitempty"` - - Zone string `json:"zone,omitempty" yaml:"zone,omitempty"` -} - -type Amazonec2ConfigCollection struct { - Collection - Data []Amazonec2Config `json:"data,omitempty"` - client *Amazonec2ConfigClient -} - -type Amazonec2ConfigClient struct { - rancherClient *RancherClient -} - -type Amazonec2ConfigOperations interface { - List(opts *ListOpts) (*Amazonec2ConfigCollection, error) - Create(opts *Amazonec2Config) (*Amazonec2Config, error) - Update(existing *Amazonec2Config, updates interface{}) (*Amazonec2Config, error) - ById(id string) (*Amazonec2Config, error) - Delete(container *Amazonec2Config) error -} - -func newAmazonec2ConfigClient(rancherClient *RancherClient) *Amazonec2ConfigClient { - return &Amazonec2ConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *Amazonec2ConfigClient) Create(container *Amazonec2Config) (*Amazonec2Config, error) { - resp := &Amazonec2Config{} - err := c.rancherClient.doCreate(AMAZONEC2CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *Amazonec2ConfigClient) Update(existing *Amazonec2Config, updates interface{}) (*Amazonec2Config, error) { - resp := &Amazonec2Config{} - err := c.rancherClient.doUpdate(AMAZONEC2CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *Amazonec2ConfigClient) List(opts *ListOpts) (*Amazonec2ConfigCollection, error) { - resp := &Amazonec2ConfigCollection{} - err := c.rancherClient.doList(AMAZONEC2CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *Amazonec2ConfigCollection) Next() (*Amazonec2ConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &Amazonec2ConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *Amazonec2ConfigClient) ById(id string) (*Amazonec2Config, error) { - resp := &Amazonec2Config{} - err := c.rancherClient.doById(AMAZONEC2CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *Amazonec2ConfigClient) Delete(container *Amazonec2Config) error { - return c.rancherClient.doResourceDelete(AMAZONEC2CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_api_key.go b/vendor/github.com/rancher/go-rancher/v2/generated_api_key.go deleted file mode 100644 index 91dc09d..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_api_key.go +++ /dev/null @@ -1,173 +0,0 @@ -package client - -const ( - API_KEY_TYPE = "apiKey" -) - -type ApiKey struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicValue string `json:"publicValue,omitempty" yaml:"public_value,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SecretValue string `json:"secretValue,omitempty" yaml:"secret_value,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ApiKeyCollection struct { - Collection - Data []ApiKey `json:"data,omitempty"` - client *ApiKeyClient -} - -type ApiKeyClient struct { - rancherClient *RancherClient -} - -type ApiKeyOperations interface { - List(opts *ListOpts) (*ApiKeyCollection, error) - Create(opts *ApiKey) (*ApiKey, error) - Update(existing *ApiKey, updates interface{}) (*ApiKey, error) - ById(id string) (*ApiKey, error) - Delete(container *ApiKey) error - - ActionActivate(*ApiKey) (*Credential, error) - - ActionCreate(*ApiKey) (*Credential, error) - - ActionDeactivate(*ApiKey) (*Credential, error) - - ActionPurge(*ApiKey) (*Credential, error) - - ActionRemove(*ApiKey) (*Credential, error) - - ActionUpdate(*ApiKey) (*Credential, error) -} - -func newApiKeyClient(rancherClient *RancherClient) *ApiKeyClient { - return &ApiKeyClient{ - rancherClient: rancherClient, - } -} - -func (c *ApiKeyClient) Create(container *ApiKey) (*ApiKey, error) { - resp := &ApiKey{} - err := c.rancherClient.doCreate(API_KEY_TYPE, container, resp) - return resp, err -} - -func (c *ApiKeyClient) Update(existing *ApiKey, updates interface{}) (*ApiKey, error) { - resp := &ApiKey{} - err := c.rancherClient.doUpdate(API_KEY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ApiKeyClient) List(opts *ListOpts) (*ApiKeyCollection, error) { - resp := &ApiKeyCollection{} - err := c.rancherClient.doList(API_KEY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ApiKeyCollection) Next() (*ApiKeyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ApiKeyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ApiKeyClient) ById(id string) (*ApiKey, error) { - resp := &ApiKey{} - err := c.rancherClient.doById(API_KEY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ApiKeyClient) Delete(container *ApiKey) error { - return c.rancherClient.doResourceDelete(API_KEY_TYPE, &container.Resource) -} - -func (c *ApiKeyClient) ActionActivate(resource *ApiKey) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(API_KEY_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ApiKeyClient) ActionCreate(resource *ApiKey) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(API_KEY_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ApiKeyClient) ActionDeactivate(resource *ApiKey) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(API_KEY_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ApiKeyClient) ActionPurge(resource *ApiKey) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(API_KEY_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ApiKeyClient) ActionRemove(resource *ApiKey) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(API_KEY_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ApiKeyClient) ActionUpdate(resource *ApiKey) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(API_KEY_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go b/vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go deleted file mode 100644 index 1c9d4ae..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go +++ /dev/null @@ -1,105 +0,0 @@ -package client - -const ( - AUDIT_LOG_TYPE = "auditLog" -) - -type AuditLog struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AuthType string `json:"authType,omitempty" yaml:"auth_type,omitempty"` - - AuthenticatedAsAccountId string `json:"authenticatedAsAccountId,omitempty" yaml:"authenticated_as_account_id,omitempty"` - - AuthenticatedAsIdentityId string `json:"authenticatedAsIdentityId,omitempty" yaml:"authenticated_as_identity_id,omitempty"` - - ClientIp string `json:"clientIp,omitempty" yaml:"client_ip,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - RequestObject string `json:"requestObject,omitempty" yaml:"request_object,omitempty"` - - ResourceId int64 `json:"resourceId,omitempty" yaml:"resource_id,omitempty"` - - ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` - - ResponseCode string `json:"responseCode,omitempty" yaml:"response_code,omitempty"` - - ResponseObject string `json:"responseObject,omitempty" yaml:"response_object,omitempty"` -} - -type AuditLogCollection struct { - Collection - Data []AuditLog `json:"data,omitempty"` - client *AuditLogClient -} - -type AuditLogClient struct { - rancherClient *RancherClient -} - -type AuditLogOperations interface { - List(opts *ListOpts) (*AuditLogCollection, error) - Create(opts *AuditLog) (*AuditLog, error) - Update(existing *AuditLog, updates interface{}) (*AuditLog, error) - ById(id string) (*AuditLog, error) - Delete(container *AuditLog) error -} - -func newAuditLogClient(rancherClient *RancherClient) *AuditLogClient { - return &AuditLogClient{ - rancherClient: rancherClient, - } -} - -func (c *AuditLogClient) Create(container *AuditLog) (*AuditLog, error) { - resp := &AuditLog{} - err := c.rancherClient.doCreate(AUDIT_LOG_TYPE, container, resp) - return resp, err -} - -func (c *AuditLogClient) Update(existing *AuditLog, updates interface{}) (*AuditLog, error) { - resp := &AuditLog{} - err := c.rancherClient.doUpdate(AUDIT_LOG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AuditLogClient) List(opts *ListOpts) (*AuditLogCollection, error) { - resp := &AuditLogCollection{} - err := c.rancherClient.doList(AUDIT_LOG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AuditLogCollection) Next() (*AuditLogCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AuditLogCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AuditLogClient) ById(id string) (*AuditLog, error) { - resp := &AuditLog{} - err := c.rancherClient.doById(AUDIT_LOG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AuditLogClient) Delete(container *AuditLog) error { - return c.rancherClient.doResourceDelete(AUDIT_LOG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go deleted file mode 100644 index 12d1b30..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go +++ /dev/null @@ -1,121 +0,0 @@ -package client - -const ( - AZURE_CONFIG_TYPE = "azureConfig" -) - -type AzureConfig struct { - Resource - - AvailabilitySet string `json:"availabilitySet,omitempty" yaml:"availability_set,omitempty"` - - ClientId string `json:"clientId,omitempty" yaml:"client_id,omitempty"` - - ClientSecret string `json:"clientSecret,omitempty" yaml:"client_secret,omitempty"` - - CustomData string `json:"customData,omitempty" yaml:"custom_data,omitempty"` - - Dns string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DockerPort string `json:"dockerPort,omitempty" yaml:"docker_port,omitempty"` - - Environment string `json:"environment,omitempty" yaml:"environment,omitempty"` - - Image string `json:"image,omitempty" yaml:"image,omitempty"` - - Location string `json:"location,omitempty" yaml:"location,omitempty"` - - NoPublicIp bool `json:"noPublicIp,omitempty" yaml:"no_public_ip,omitempty"` - - OpenPort []string `json:"openPort,omitempty" yaml:"open_port,omitempty"` - - PrivateIpAddress string `json:"privateIpAddress,omitempty" yaml:"private_ip_address,omitempty"` - - ResourceGroup string `json:"resourceGroup,omitempty" yaml:"resource_group,omitempty"` - - Size string `json:"size,omitempty" yaml:"size,omitempty"` - - SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` - - StaticPublicIp bool `json:"staticPublicIp,omitempty" yaml:"static_public_ip,omitempty"` - - StorageType string `json:"storageType,omitempty" yaml:"storage_type,omitempty"` - - Subnet string `json:"subnet,omitempty" yaml:"subnet,omitempty"` - - SubnetPrefix string `json:"subnetPrefix,omitempty" yaml:"subnet_prefix,omitempty"` - - SubscriptionId string `json:"subscriptionId,omitempty" yaml:"subscription_id,omitempty"` - - UsePrivateIp bool `json:"usePrivateIp,omitempty" yaml:"use_private_ip,omitempty"` - - Vnet string `json:"vnet,omitempty" yaml:"vnet,omitempty"` -} - -type AzureConfigCollection struct { - Collection - Data []AzureConfig `json:"data,omitempty"` - client *AzureConfigClient -} - -type AzureConfigClient struct { - rancherClient *RancherClient -} - -type AzureConfigOperations interface { - List(opts *ListOpts) (*AzureConfigCollection, error) - Create(opts *AzureConfig) (*AzureConfig, error) - Update(existing *AzureConfig, updates interface{}) (*AzureConfig, error) - ById(id string) (*AzureConfig, error) - Delete(container *AzureConfig) error -} - -func newAzureConfigClient(rancherClient *RancherClient) *AzureConfigClient { - return &AzureConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *AzureConfigClient) Create(container *AzureConfig) (*AzureConfig, error) { - resp := &AzureConfig{} - err := c.rancherClient.doCreate(AZURE_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *AzureConfigClient) Update(existing *AzureConfig, updates interface{}) (*AzureConfig, error) { - resp := &AzureConfig{} - err := c.rancherClient.doUpdate(AZURE_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AzureConfigClient) List(opts *ListOpts) (*AzureConfigCollection, error) { - resp := &AzureConfigCollection{} - err := c.rancherClient.doList(AZURE_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AzureConfigCollection) Next() (*AzureConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AzureConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AzureConfigClient) ById(id string) (*AzureConfig, error) { - resp := &AzureConfig{} - err := c.rancherClient.doById(AZURE_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AzureConfigClient) Delete(container *AzureConfig) error { - return c.rancherClient.doResourceDelete(AZURE_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go b/vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go deleted file mode 100644 index 5b3117f..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go +++ /dev/null @@ -1,93 +0,0 @@ -package client - -const ( - AZUREADCONFIG_TYPE = "azureadconfig" -) - -type Azureadconfig struct { - Resource - - AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` - - AdminAccountPassword string `json:"adminAccountPassword,omitempty" yaml:"admin_account_password,omitempty"` - - AdminAccountUsername string `json:"adminAccountUsername,omitempty" yaml:"admin_account_username,omitempty"` - - ClientId string `json:"clientId,omitempty" yaml:"client_id,omitempty"` - - Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` - - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - TenantId string `json:"tenantId,omitempty" yaml:"tenant_id,omitempty"` -} - -type AzureadconfigCollection struct { - Collection - Data []Azureadconfig `json:"data,omitempty"` - client *AzureadconfigClient -} - -type AzureadconfigClient struct { - rancherClient *RancherClient -} - -type AzureadconfigOperations interface { - List(opts *ListOpts) (*AzureadconfigCollection, error) - Create(opts *Azureadconfig) (*Azureadconfig, error) - Update(existing *Azureadconfig, updates interface{}) (*Azureadconfig, error) - ById(id string) (*Azureadconfig, error) - Delete(container *Azureadconfig) error -} - -func newAzureadconfigClient(rancherClient *RancherClient) *AzureadconfigClient { - return &AzureadconfigClient{ - rancherClient: rancherClient, - } -} - -func (c *AzureadconfigClient) Create(container *Azureadconfig) (*Azureadconfig, error) { - resp := &Azureadconfig{} - err := c.rancherClient.doCreate(AZUREADCONFIG_TYPE, container, resp) - return resp, err -} - -func (c *AzureadconfigClient) Update(existing *Azureadconfig, updates interface{}) (*Azureadconfig, error) { - resp := &Azureadconfig{} - err := c.rancherClient.doUpdate(AZUREADCONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AzureadconfigClient) List(opts *ListOpts) (*AzureadconfigCollection, error) { - resp := &AzureadconfigCollection{} - err := c.rancherClient.doList(AZUREADCONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AzureadconfigCollection) Next() (*AzureadconfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AzureadconfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AzureadconfigClient) ById(id string) (*Azureadconfig, error) { - resp := &Azureadconfig{} - err := c.rancherClient.doById(AZUREADCONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AzureadconfigClient) Delete(container *Azureadconfig) error { - return c.rancherClient.doResourceDelete(AZUREADCONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_backup.go b/vendor/github.com/rancher/go-rancher/v2/generated_backup.go deleted file mode 100644 index 755605e..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_backup.go +++ /dev/null @@ -1,133 +0,0 @@ -package client - -const ( - BACKUP_TYPE = "backup" -) - -type Backup struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - BackupTargetId string `json:"backupTargetId,omitempty" yaml:"backup_target_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SnapshotId string `json:"snapshotId,omitempty" yaml:"snapshot_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` -} - -type BackupCollection struct { - Collection - Data []Backup `json:"data,omitempty"` - client *BackupClient -} - -type BackupClient struct { - rancherClient *RancherClient -} - -type BackupOperations interface { - List(opts *ListOpts) (*BackupCollection, error) - Create(opts *Backup) (*Backup, error) - Update(existing *Backup, updates interface{}) (*Backup, error) - ById(id string) (*Backup, error) - Delete(container *Backup) error - - ActionCreate(*Backup) (*Backup, error) - - ActionRemove(*Backup) (*Backup, error) -} - -func newBackupClient(rancherClient *RancherClient) *BackupClient { - return &BackupClient{ - rancherClient: rancherClient, - } -} - -func (c *BackupClient) Create(container *Backup) (*Backup, error) { - resp := &Backup{} - err := c.rancherClient.doCreate(BACKUP_TYPE, container, resp) - return resp, err -} - -func (c *BackupClient) Update(existing *Backup, updates interface{}) (*Backup, error) { - resp := &Backup{} - err := c.rancherClient.doUpdate(BACKUP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *BackupClient) List(opts *ListOpts) (*BackupCollection, error) { - resp := &BackupCollection{} - err := c.rancherClient.doList(BACKUP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *BackupCollection) Next() (*BackupCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &BackupCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *BackupClient) ById(id string) (*Backup, error) { - resp := &Backup{} - err := c.rancherClient.doById(BACKUP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *BackupClient) Delete(container *Backup) error { - return c.rancherClient.doResourceDelete(BACKUP_TYPE, &container.Resource) -} - -func (c *BackupClient) ActionCreate(resource *Backup) (*Backup, error) { - - resp := &Backup{} - - err := c.rancherClient.doAction(BACKUP_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *BackupClient) ActionRemove(resource *Backup) (*Backup, error) { - - resp := &Backup{} - - err := c.rancherClient.doAction(BACKUP_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go b/vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go deleted file mode 100644 index a00f2bc..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go +++ /dev/null @@ -1,127 +0,0 @@ -package client - -const ( - BACKUP_TARGET_TYPE = "backupTarget" -) - -type BackupTarget struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NfsConfig *NfsConfig `json:"nfsConfig,omitempty" yaml:"nfs_config,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type BackupTargetCollection struct { - Collection - Data []BackupTarget `json:"data,omitempty"` - client *BackupTargetClient -} - -type BackupTargetClient struct { - rancherClient *RancherClient -} - -type BackupTargetOperations interface { - List(opts *ListOpts) (*BackupTargetCollection, error) - Create(opts *BackupTarget) (*BackupTarget, error) - Update(existing *BackupTarget, updates interface{}) (*BackupTarget, error) - ById(id string) (*BackupTarget, error) - Delete(container *BackupTarget) error - - ActionCreate(*BackupTarget) (*BackupTarget, error) - - ActionRemove(*BackupTarget) (*BackupTarget, error) -} - -func newBackupTargetClient(rancherClient *RancherClient) *BackupTargetClient { - return &BackupTargetClient{ - rancherClient: rancherClient, - } -} - -func (c *BackupTargetClient) Create(container *BackupTarget) (*BackupTarget, error) { - resp := &BackupTarget{} - err := c.rancherClient.doCreate(BACKUP_TARGET_TYPE, container, resp) - return resp, err -} - -func (c *BackupTargetClient) Update(existing *BackupTarget, updates interface{}) (*BackupTarget, error) { - resp := &BackupTarget{} - err := c.rancherClient.doUpdate(BACKUP_TARGET_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *BackupTargetClient) List(opts *ListOpts) (*BackupTargetCollection, error) { - resp := &BackupTargetCollection{} - err := c.rancherClient.doList(BACKUP_TARGET_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *BackupTargetCollection) Next() (*BackupTargetCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &BackupTargetCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *BackupTargetClient) ById(id string) (*BackupTarget, error) { - resp := &BackupTarget{} - err := c.rancherClient.doById(BACKUP_TARGET_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *BackupTargetClient) Delete(container *BackupTarget) error { - return c.rancherClient.doResourceDelete(BACKUP_TARGET_TYPE, &container.Resource) -} - -func (c *BackupTargetClient) ActionCreate(resource *BackupTarget) (*BackupTarget, error) { - - resp := &BackupTarget{} - - err := c.rancherClient.doAction(BACKUP_TARGET_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *BackupTargetClient) ActionRemove(resource *BackupTarget) (*BackupTarget, error) { - - resp := &BackupTarget{} - - err := c.rancherClient.doAction(BACKUP_TARGET_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go deleted file mode 100644 index 0c0112d..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go +++ /dev/null @@ -1,77 +0,0 @@ -package client - -const ( - BASE_MACHINE_CONFIG_TYPE = "baseMachineConfig" -) - -type BaseMachineConfig struct { - Resource -} - -type BaseMachineConfigCollection struct { - Collection - Data []BaseMachineConfig `json:"data,omitempty"` - client *BaseMachineConfigClient -} - -type BaseMachineConfigClient struct { - rancherClient *RancherClient -} - -type BaseMachineConfigOperations interface { - List(opts *ListOpts) (*BaseMachineConfigCollection, error) - Create(opts *BaseMachineConfig) (*BaseMachineConfig, error) - Update(existing *BaseMachineConfig, updates interface{}) (*BaseMachineConfig, error) - ById(id string) (*BaseMachineConfig, error) - Delete(container *BaseMachineConfig) error -} - -func newBaseMachineConfigClient(rancherClient *RancherClient) *BaseMachineConfigClient { - return &BaseMachineConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *BaseMachineConfigClient) Create(container *BaseMachineConfig) (*BaseMachineConfig, error) { - resp := &BaseMachineConfig{} - err := c.rancherClient.doCreate(BASE_MACHINE_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *BaseMachineConfigClient) Update(existing *BaseMachineConfig, updates interface{}) (*BaseMachineConfig, error) { - resp := &BaseMachineConfig{} - err := c.rancherClient.doUpdate(BASE_MACHINE_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *BaseMachineConfigClient) List(opts *ListOpts) (*BaseMachineConfigCollection, error) { - resp := &BaseMachineConfigCollection{} - err := c.rancherClient.doList(BASE_MACHINE_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *BaseMachineConfigCollection) Next() (*BaseMachineConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &BaseMachineConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *BaseMachineConfigClient) ById(id string) (*BaseMachineConfig, error) { - resp := &BaseMachineConfig{} - err := c.rancherClient.doById(BASE_MACHINE_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *BaseMachineConfigClient) Delete(container *BaseMachineConfig) error { - return c.rancherClient.doResourceDelete(BASE_MACHINE_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_binding.go b/vendor/github.com/rancher/go-rancher/v2/generated_binding.go deleted file mode 100644 index 9cb4e17..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_binding.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - BINDING_TYPE = "binding" -) - -type Binding struct { - Resource - - Services map[string]interface{} `json:"services,omitempty" yaml:"services,omitempty"` -} - -type BindingCollection struct { - Collection - Data []Binding `json:"data,omitempty"` - client *BindingClient -} - -type BindingClient struct { - rancherClient *RancherClient -} - -type BindingOperations interface { - List(opts *ListOpts) (*BindingCollection, error) - Create(opts *Binding) (*Binding, error) - Update(existing *Binding, updates interface{}) (*Binding, error) - ById(id string) (*Binding, error) - Delete(container *Binding) error -} - -func newBindingClient(rancherClient *RancherClient) *BindingClient { - return &BindingClient{ - rancherClient: rancherClient, - } -} - -func (c *BindingClient) Create(container *Binding) (*Binding, error) { - resp := &Binding{} - err := c.rancherClient.doCreate(BINDING_TYPE, container, resp) - return resp, err -} - -func (c *BindingClient) Update(existing *Binding, updates interface{}) (*Binding, error) { - resp := &Binding{} - err := c.rancherClient.doUpdate(BINDING_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *BindingClient) List(opts *ListOpts) (*BindingCollection, error) { - resp := &BindingCollection{} - err := c.rancherClient.doList(BINDING_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *BindingCollection) Next() (*BindingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &BindingCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *BindingClient) ById(id string) (*Binding, error) { - resp := &Binding{} - err := c.rancherClient.doById(BINDING_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *BindingClient) Delete(container *Binding) error { - return c.rancherClient.doResourceDelete(BINDING_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go b/vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go deleted file mode 100644 index bc33c7c..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - BLKIO_DEVICE_OPTION_TYPE = "blkioDeviceOption" -) - -type BlkioDeviceOption struct { - Resource - - ReadBps int64 `json:"readBps,omitempty" yaml:"read_bps,omitempty"` - - ReadIops int64 `json:"readIops,omitempty" yaml:"read_iops,omitempty"` - - Weight int64 `json:"weight,omitempty" yaml:"weight,omitempty"` - - WriteBps int64 `json:"writeBps,omitempty" yaml:"write_bps,omitempty"` - - WriteIops int64 `json:"writeIops,omitempty" yaml:"write_iops,omitempty"` -} - -type BlkioDeviceOptionCollection struct { - Collection - Data []BlkioDeviceOption `json:"data,omitempty"` - client *BlkioDeviceOptionClient -} - -type BlkioDeviceOptionClient struct { - rancherClient *RancherClient -} - -type BlkioDeviceOptionOperations interface { - List(opts *ListOpts) (*BlkioDeviceOptionCollection, error) - Create(opts *BlkioDeviceOption) (*BlkioDeviceOption, error) - Update(existing *BlkioDeviceOption, updates interface{}) (*BlkioDeviceOption, error) - ById(id string) (*BlkioDeviceOption, error) - Delete(container *BlkioDeviceOption) error -} - -func newBlkioDeviceOptionClient(rancherClient *RancherClient) *BlkioDeviceOptionClient { - return &BlkioDeviceOptionClient{ - rancherClient: rancherClient, - } -} - -func (c *BlkioDeviceOptionClient) Create(container *BlkioDeviceOption) (*BlkioDeviceOption, error) { - resp := &BlkioDeviceOption{} - err := c.rancherClient.doCreate(BLKIO_DEVICE_OPTION_TYPE, container, resp) - return resp, err -} - -func (c *BlkioDeviceOptionClient) Update(existing *BlkioDeviceOption, updates interface{}) (*BlkioDeviceOption, error) { - resp := &BlkioDeviceOption{} - err := c.rancherClient.doUpdate(BLKIO_DEVICE_OPTION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *BlkioDeviceOptionClient) List(opts *ListOpts) (*BlkioDeviceOptionCollection, error) { - resp := &BlkioDeviceOptionCollection{} - err := c.rancherClient.doList(BLKIO_DEVICE_OPTION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *BlkioDeviceOptionCollection) Next() (*BlkioDeviceOptionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &BlkioDeviceOptionCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *BlkioDeviceOptionClient) ById(id string) (*BlkioDeviceOption, error) { - resp := &BlkioDeviceOption{} - err := c.rancherClient.doById(BLKIO_DEVICE_OPTION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *BlkioDeviceOptionClient) Delete(container *BlkioDeviceOption) error { - return c.rancherClient.doResourceDelete(BLKIO_DEVICE_OPTION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go deleted file mode 100644 index 67d073e..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go +++ /dev/null @@ -1,93 +0,0 @@ -package client - -const ( - CATALOG_TEMPLATE_TYPE = "catalogTemplate" -) - -type CatalogTemplate struct { - Resource - - Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` - - Binding Binding `json:"binding,omitempty" yaml:"binding,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` - - TemplateId string `json:"templateId,omitempty" yaml:"template_id,omitempty"` - - TemplateVersionId string `json:"templateVersionId,omitempty" yaml:"template_version_id,omitempty"` -} - -type CatalogTemplateCollection struct { - Collection - Data []CatalogTemplate `json:"data,omitempty"` - client *CatalogTemplateClient -} - -type CatalogTemplateClient struct { - rancherClient *RancherClient -} - -type CatalogTemplateOperations interface { - List(opts *ListOpts) (*CatalogTemplateCollection, error) - Create(opts *CatalogTemplate) (*CatalogTemplate, error) - Update(existing *CatalogTemplate, updates interface{}) (*CatalogTemplate, error) - ById(id string) (*CatalogTemplate, error) - Delete(container *CatalogTemplate) error -} - -func newCatalogTemplateClient(rancherClient *RancherClient) *CatalogTemplateClient { - return &CatalogTemplateClient{ - rancherClient: rancherClient, - } -} - -func (c *CatalogTemplateClient) Create(container *CatalogTemplate) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.rancherClient.doCreate(CATALOG_TEMPLATE_TYPE, container, resp) - return resp, err -} - -func (c *CatalogTemplateClient) Update(existing *CatalogTemplate, updates interface{}) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.rancherClient.doUpdate(CATALOG_TEMPLATE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *CatalogTemplateClient) List(opts *ListOpts) (*CatalogTemplateCollection, error) { - resp := &CatalogTemplateCollection{} - err := c.rancherClient.doList(CATALOG_TEMPLATE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *CatalogTemplateCollection) Next() (*CatalogTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &CatalogTemplateCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *CatalogTemplateClient) ById(id string) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.rancherClient.doById(CATALOG_TEMPLATE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *CatalogTemplateClient) Delete(container *CatalogTemplate) error { - return c.rancherClient.doResourceDelete(CATALOG_TEMPLATE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_certificate.go b/vendor/github.com/rancher/go-rancher/v2/generated_certificate.go deleted file mode 100644 index fc407e8..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_certificate.go +++ /dev/null @@ -1,162 +0,0 @@ -package client - -const ( - CERTIFICATE_TYPE = "certificate" -) - -type Certificate struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Algorithm string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"` - - CN string `json:"cN,omitempty" yaml:"cn,omitempty"` - - Cert string `json:"cert,omitempty" yaml:"cert,omitempty"` - - CertChain string `json:"certChain,omitempty" yaml:"cert_chain,omitempty"` - - CertFingerprint string `json:"certFingerprint,omitempty" yaml:"cert_fingerprint,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExpiresAt string `json:"expiresAt,omitempty" yaml:"expires_at,omitempty"` - - IssuedAt string `json:"issuedAt,omitempty" yaml:"issued_at,omitempty"` - - Issuer string `json:"issuer,omitempty" yaml:"issuer,omitempty"` - - Key string `json:"key,omitempty" yaml:"key,omitempty"` - - KeySize int64 `json:"keySize,omitempty" yaml:"key_size,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SerialNumber string `json:"serialNumber,omitempty" yaml:"serial_number,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty" yaml:"subject_alternative_names,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` -} - -type CertificateCollection struct { - Collection - Data []Certificate `json:"data,omitempty"` - client *CertificateClient -} - -type CertificateClient struct { - rancherClient *RancherClient -} - -type CertificateOperations interface { - List(opts *ListOpts) (*CertificateCollection, error) - Create(opts *Certificate) (*Certificate, error) - Update(existing *Certificate, updates interface{}) (*Certificate, error) - ById(id string) (*Certificate, error) - Delete(container *Certificate) error - - ActionCreate(*Certificate) (*Certificate, error) - - ActionRemove(*Certificate) (*Certificate, error) - - ActionUpdate(*Certificate) (*Certificate, error) -} - -func newCertificateClient(rancherClient *RancherClient) *CertificateClient { - return &CertificateClient{ - rancherClient: rancherClient, - } -} - -func (c *CertificateClient) Create(container *Certificate) (*Certificate, error) { - resp := &Certificate{} - err := c.rancherClient.doCreate(CERTIFICATE_TYPE, container, resp) - return resp, err -} - -func (c *CertificateClient) Update(existing *Certificate, updates interface{}) (*Certificate, error) { - resp := &Certificate{} - err := c.rancherClient.doUpdate(CERTIFICATE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *CertificateClient) List(opts *ListOpts) (*CertificateCollection, error) { - resp := &CertificateCollection{} - err := c.rancherClient.doList(CERTIFICATE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *CertificateCollection) Next() (*CertificateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &CertificateCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *CertificateClient) ById(id string) (*Certificate, error) { - resp := &Certificate{} - err := c.rancherClient.doById(CERTIFICATE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *CertificateClient) Delete(container *Certificate) error { - return c.rancherClient.doResourceDelete(CERTIFICATE_TYPE, &container.Resource) -} - -func (c *CertificateClient) ActionCreate(resource *Certificate) (*Certificate, error) { - - resp := &Certificate{} - - err := c.rancherClient.doAction(CERTIFICATE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CertificateClient) ActionRemove(resource *Certificate) (*Certificate, error) { - - resp := &Certificate{} - - err := c.rancherClient.doAction(CERTIFICATE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CertificateClient) ActionUpdate(resource *Certificate) (*Certificate, error) { - - resp := &Certificate{} - - err := c.rancherClient.doAction(CERTIFICATE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go deleted file mode 100644 index 3f86681..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - CHANGE_SECRET_INPUT_TYPE = "changeSecretInput" -) - -type ChangeSecretInput struct { - Resource - - NewSecret string `json:"newSecret,omitempty" yaml:"new_secret,omitempty"` - - OldSecret string `json:"oldSecret,omitempty" yaml:"old_secret,omitempty"` -} - -type ChangeSecretInputCollection struct { - Collection - Data []ChangeSecretInput `json:"data,omitempty"` - client *ChangeSecretInputClient -} - -type ChangeSecretInputClient struct { - rancherClient *RancherClient -} - -type ChangeSecretInputOperations interface { - List(opts *ListOpts) (*ChangeSecretInputCollection, error) - Create(opts *ChangeSecretInput) (*ChangeSecretInput, error) - Update(existing *ChangeSecretInput, updates interface{}) (*ChangeSecretInput, error) - ById(id string) (*ChangeSecretInput, error) - Delete(container *ChangeSecretInput) error -} - -func newChangeSecretInputClient(rancherClient *RancherClient) *ChangeSecretInputClient { - return &ChangeSecretInputClient{ - rancherClient: rancherClient, - } -} - -func (c *ChangeSecretInputClient) Create(container *ChangeSecretInput) (*ChangeSecretInput, error) { - resp := &ChangeSecretInput{} - err := c.rancherClient.doCreate(CHANGE_SECRET_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *ChangeSecretInputClient) Update(existing *ChangeSecretInput, updates interface{}) (*ChangeSecretInput, error) { - resp := &ChangeSecretInput{} - err := c.rancherClient.doUpdate(CHANGE_SECRET_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ChangeSecretInputClient) List(opts *ListOpts) (*ChangeSecretInputCollection, error) { - resp := &ChangeSecretInputCollection{} - err := c.rancherClient.doList(CHANGE_SECRET_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ChangeSecretInputCollection) Next() (*ChangeSecretInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ChangeSecretInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ChangeSecretInputClient) ById(id string) (*ChangeSecretInput, error) { - resp := &ChangeSecretInput{} - err := c.rancherClient.doById(CHANGE_SECRET_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ChangeSecretInputClient) Delete(container *ChangeSecretInput) error { - return c.rancherClient.doResourceDelete(CHANGE_SECRET_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_client.go b/vendor/github.com/rancher/go-rancher/v2/generated_client.go deleted file mode 100644 index 244ddb7..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_client.go +++ /dev/null @@ -1,353 +0,0 @@ -package client - -type RancherClient struct { - RancherBaseClient - - Account AccountOperations - ActiveSetting ActiveSettingOperations - AddOutputsInput AddOutputsInputOperations - AddRemoveServiceLinkInput AddRemoveServiceLinkInputOperations - Agent AgentOperations - Amazonec2Config Amazonec2ConfigOperations - ApiKey ApiKeyOperations - AuditLog AuditLogOperations - AzureConfig AzureConfigOperations - Azureadconfig AzureadconfigOperations - Backup BackupOperations - BackupTarget BackupTargetOperations - BaseMachineConfig BaseMachineConfigOperations - Binding BindingOperations - BlkioDeviceOption BlkioDeviceOptionOperations - CatalogTemplate CatalogTemplateOperations - Certificate CertificateOperations - ChangeSecretInput ChangeSecretInputOperations - ClusterMembership ClusterMembershipOperations - ComposeConfig ComposeConfigOperations - ComposeConfigInput ComposeConfigInputOperations - ComposeProject ComposeProjectOperations - ComposeService ComposeServiceOperations - ConfigItem ConfigItemOperations - ConfigItemStatus ConfigItemStatusOperations - Container ContainerOperations - ContainerEvent ContainerEventOperations - ContainerExec ContainerExecOperations - ContainerLogs ContainerLogsOperations - ContainerProxy ContainerProxyOperations - Credential CredentialOperations - Databasechangelog DatabasechangelogOperations - Databasechangeloglock DatabasechangeloglockOperations - DefaultNetwork DefaultNetworkOperations - DigitaloceanConfig DigitaloceanConfigOperations - DnsService DnsServiceOperations - DockerBuild DockerBuildOperations - ExtensionImplementation ExtensionImplementationOperations - ExtensionPoint ExtensionPointOperations - ExternalDnsEvent ExternalDnsEventOperations - ExternalEvent ExternalEventOperations - ExternalHandler ExternalHandlerOperations - ExternalHandlerExternalHandlerProcessMap ExternalHandlerExternalHandlerProcessMapOperations - ExternalHandlerProcess ExternalHandlerProcessOperations - ExternalHandlerProcessConfig ExternalHandlerProcessConfigOperations - ExternalHostEvent ExternalHostEventOperations - ExternalService ExternalServiceOperations - ExternalServiceEvent ExternalServiceEventOperations - ExternalStoragePoolEvent ExternalStoragePoolEventOperations - ExternalVolumeEvent ExternalVolumeEventOperations - FieldDocumentation FieldDocumentationOperations - GenericObject GenericObjectOperations - HaConfig HaConfigOperations - HaConfigInput HaConfigInputOperations - HealthcheckInstanceHostMap HealthcheckInstanceHostMapOperations - Host HostOperations - HostAccess HostAccessOperations - HostApiProxyToken HostApiProxyTokenOperations - HostTemplate HostTemplateOperations - Identity IdentityOperations - Image ImageOperations - InServiceUpgradeStrategy InServiceUpgradeStrategyOperations - Instance InstanceOperations - InstanceConsole InstanceConsoleOperations - InstanceConsoleInput InstanceConsoleInputOperations - InstanceHealthCheck InstanceHealthCheckOperations - InstanceLink InstanceLinkOperations - InstanceStop InstanceStopOperations - IpAddress IpAddressOperations - KubernetesService KubernetesServiceOperations - KubernetesStack KubernetesStackOperations - KubernetesStackUpgrade KubernetesStackUpgradeOperations - Label LabelOperations - LaunchConfig LaunchConfigOperations - LbConfig LbConfigOperations - LbTargetConfig LbTargetConfigOperations - LoadBalancerCookieStickinessPolicy LoadBalancerCookieStickinessPolicyOperations - LoadBalancerService LoadBalancerServiceOperations - LocalAuthConfig LocalAuthConfigOperations - LogConfig LogConfigOperations - Machine MachineOperations - MachineDriver MachineDriverOperations - Mount MountOperations - MountEntry MountEntryOperations - Network NetworkOperations - NetworkDriver NetworkDriverOperations - NetworkDriverService NetworkDriverServiceOperations - NetworkPolicyRule NetworkPolicyRuleOperations - NetworkPolicyRuleBetween NetworkPolicyRuleBetweenOperations - NetworkPolicyRuleMember NetworkPolicyRuleMemberOperations - NetworkPolicyRuleWithin NetworkPolicyRuleWithinOperations - NfsConfig NfsConfigOperations - Openldapconfig OpenldapconfigOperations - PacketConfig PacketConfigOperations - Password PasswordOperations - PhysicalHost PhysicalHostOperations - Port PortOperations - PortRule PortRuleOperations - ProcessDefinition ProcessDefinitionOperations - ProcessExecution ProcessExecutionOperations - ProcessInstance ProcessInstanceOperations - ProcessPool ProcessPoolOperations - ProcessSummary ProcessSummaryOperations - Project ProjectOperations - ProjectMember ProjectMemberOperations - ProjectTemplate ProjectTemplateOperations - PublicEndpoint PublicEndpointOperations - Publish PublishOperations - PullTask PullTaskOperations - RecreateOnQuorumStrategyConfig RecreateOnQuorumStrategyConfigOperations - Register RegisterOperations - RegistrationToken RegistrationTokenOperations - Registry RegistryOperations - RegistryCredential RegistryCredentialOperations - ResourceDefinition ResourceDefinitionOperations - RestartPolicy RestartPolicyOperations - RestoreFromBackupInput RestoreFromBackupInputOperations - RevertToSnapshotInput RevertToSnapshotInputOperations - RollingRestartStrategy RollingRestartStrategyOperations - ScalePolicy ScalePolicyOperations - ScheduledUpgrade ScheduledUpgradeOperations - SecondaryLaunchConfig SecondaryLaunchConfigOperations - Secret SecretOperations - SecretReference SecretReferenceOperations - Service ServiceOperations - ServiceBinding ServiceBindingOperations - ServiceConsumeMap ServiceConsumeMapOperations - ServiceEvent ServiceEventOperations - ServiceExposeMap ServiceExposeMapOperations - ServiceLink ServiceLinkOperations - ServiceLog ServiceLogOperations - ServiceProxy ServiceProxyOperations - ServiceRestart ServiceRestartOperations - ServiceUpgrade ServiceUpgradeOperations - ServiceUpgradeStrategy ServiceUpgradeStrategyOperations - ServicesPortRange ServicesPortRangeOperations - SetProjectMembersInput SetProjectMembersInputOperations - SetServiceLinksInput SetServiceLinksInputOperations - Setting SettingOperations - Snapshot SnapshotOperations - SnapshotBackupInput SnapshotBackupInputOperations - Stack StackOperations - StackUpgrade StackUpgradeOperations - StateTransition StateTransitionOperations - StatsAccess StatsAccessOperations - StorageDriver StorageDriverOperations - StorageDriverService StorageDriverServiceOperations - StoragePool StoragePoolOperations - Subnet SubnetOperations - TargetPortRule TargetPortRuleOperations - Task TaskOperations - TaskInstance TaskInstanceOperations - ToServiceUpgradeStrategy ToServiceUpgradeStrategyOperations - TypeDocumentation TypeDocumentationOperations - Ulimit UlimitOperations - UserPreference UserPreferenceOperations - VirtualMachine VirtualMachineOperations - VirtualMachineDisk VirtualMachineDiskOperations - Volume VolumeOperations - VolumeActivateInput VolumeActivateInputOperations - VolumeSnapshotInput VolumeSnapshotInputOperations - VolumeTemplate VolumeTemplateOperations -} - -func constructClient(rancherBaseClient *RancherBaseClientImpl) *RancherClient { - client := &RancherClient{ - RancherBaseClient: rancherBaseClient, - } - - client.Account = newAccountClient(client) - client.ActiveSetting = newActiveSettingClient(client) - client.AddOutputsInput = newAddOutputsInputClient(client) - client.AddRemoveServiceLinkInput = newAddRemoveServiceLinkInputClient(client) - client.Agent = newAgentClient(client) - client.Amazonec2Config = newAmazonec2ConfigClient(client) - client.ApiKey = newApiKeyClient(client) - client.AuditLog = newAuditLogClient(client) - client.AzureConfig = newAzureConfigClient(client) - client.Azureadconfig = newAzureadconfigClient(client) - client.Backup = newBackupClient(client) - client.BackupTarget = newBackupTargetClient(client) - client.BaseMachineConfig = newBaseMachineConfigClient(client) - client.Binding = newBindingClient(client) - client.BlkioDeviceOption = newBlkioDeviceOptionClient(client) - client.CatalogTemplate = newCatalogTemplateClient(client) - client.Certificate = newCertificateClient(client) - client.ChangeSecretInput = newChangeSecretInputClient(client) - client.ClusterMembership = newClusterMembershipClient(client) - client.ComposeConfig = newComposeConfigClient(client) - client.ComposeConfigInput = newComposeConfigInputClient(client) - client.ComposeProject = newComposeProjectClient(client) - client.ComposeService = newComposeServiceClient(client) - client.ConfigItem = newConfigItemClient(client) - client.ConfigItemStatus = newConfigItemStatusClient(client) - client.Container = newContainerClient(client) - client.ContainerEvent = newContainerEventClient(client) - client.ContainerExec = newContainerExecClient(client) - client.ContainerLogs = newContainerLogsClient(client) - client.ContainerProxy = newContainerProxyClient(client) - client.Credential = newCredentialClient(client) - client.Databasechangelog = newDatabasechangelogClient(client) - client.Databasechangeloglock = newDatabasechangeloglockClient(client) - client.DefaultNetwork = newDefaultNetworkClient(client) - client.DigitaloceanConfig = newDigitaloceanConfigClient(client) - client.DnsService = newDnsServiceClient(client) - client.DockerBuild = newDockerBuildClient(client) - client.ExtensionImplementation = newExtensionImplementationClient(client) - client.ExtensionPoint = newExtensionPointClient(client) - client.ExternalDnsEvent = newExternalDnsEventClient(client) - client.ExternalEvent = newExternalEventClient(client) - client.ExternalHandler = newExternalHandlerClient(client) - client.ExternalHandlerExternalHandlerProcessMap = newExternalHandlerExternalHandlerProcessMapClient(client) - client.ExternalHandlerProcess = newExternalHandlerProcessClient(client) - client.ExternalHandlerProcessConfig = newExternalHandlerProcessConfigClient(client) - client.ExternalHostEvent = newExternalHostEventClient(client) - client.ExternalService = newExternalServiceClient(client) - client.ExternalServiceEvent = newExternalServiceEventClient(client) - client.ExternalStoragePoolEvent = newExternalStoragePoolEventClient(client) - client.ExternalVolumeEvent = newExternalVolumeEventClient(client) - client.FieldDocumentation = newFieldDocumentationClient(client) - client.GenericObject = newGenericObjectClient(client) - client.HaConfig = newHaConfigClient(client) - client.HaConfigInput = newHaConfigInputClient(client) - client.HealthcheckInstanceHostMap = newHealthcheckInstanceHostMapClient(client) - client.Host = newHostClient(client) - client.HostAccess = newHostAccessClient(client) - client.HostApiProxyToken = newHostApiProxyTokenClient(client) - client.HostTemplate = newHostTemplateClient(client) - client.Identity = newIdentityClient(client) - client.Image = newImageClient(client) - client.InServiceUpgradeStrategy = newInServiceUpgradeStrategyClient(client) - client.Instance = newInstanceClient(client) - client.InstanceConsole = newInstanceConsoleClient(client) - client.InstanceConsoleInput = newInstanceConsoleInputClient(client) - client.InstanceHealthCheck = newInstanceHealthCheckClient(client) - client.InstanceLink = newInstanceLinkClient(client) - client.InstanceStop = newInstanceStopClient(client) - client.IpAddress = newIpAddressClient(client) - client.KubernetesService = newKubernetesServiceClient(client) - client.KubernetesStack = newKubernetesStackClient(client) - client.KubernetesStackUpgrade = newKubernetesStackUpgradeClient(client) - client.Label = newLabelClient(client) - client.LaunchConfig = newLaunchConfigClient(client) - client.LbConfig = newLbConfigClient(client) - client.LbTargetConfig = newLbTargetConfigClient(client) - client.LoadBalancerCookieStickinessPolicy = newLoadBalancerCookieStickinessPolicyClient(client) - client.LoadBalancerService = newLoadBalancerServiceClient(client) - client.LocalAuthConfig = newLocalAuthConfigClient(client) - client.LogConfig = newLogConfigClient(client) - client.Machine = newMachineClient(client) - client.MachineDriver = newMachineDriverClient(client) - client.Mount = newMountClient(client) - client.MountEntry = newMountEntryClient(client) - client.Network = newNetworkClient(client) - client.NetworkDriver = newNetworkDriverClient(client) - client.NetworkDriverService = newNetworkDriverServiceClient(client) - client.NetworkPolicyRule = newNetworkPolicyRuleClient(client) - client.NetworkPolicyRuleBetween = newNetworkPolicyRuleBetweenClient(client) - client.NetworkPolicyRuleMember = newNetworkPolicyRuleMemberClient(client) - client.NetworkPolicyRuleWithin = newNetworkPolicyRuleWithinClient(client) - client.NfsConfig = newNfsConfigClient(client) - client.Openldapconfig = newOpenldapconfigClient(client) - client.PacketConfig = newPacketConfigClient(client) - client.Password = newPasswordClient(client) - client.PhysicalHost = newPhysicalHostClient(client) - client.Port = newPortClient(client) - client.PortRule = newPortRuleClient(client) - client.ProcessDefinition = newProcessDefinitionClient(client) - client.ProcessExecution = newProcessExecutionClient(client) - client.ProcessInstance = newProcessInstanceClient(client) - client.ProcessPool = newProcessPoolClient(client) - client.ProcessSummary = newProcessSummaryClient(client) - client.Project = newProjectClient(client) - client.ProjectMember = newProjectMemberClient(client) - client.ProjectTemplate = newProjectTemplateClient(client) - client.PublicEndpoint = newPublicEndpointClient(client) - client.Publish = newPublishClient(client) - client.PullTask = newPullTaskClient(client) - client.RecreateOnQuorumStrategyConfig = newRecreateOnQuorumStrategyConfigClient(client) - client.Register = newRegisterClient(client) - client.RegistrationToken = newRegistrationTokenClient(client) - client.Registry = newRegistryClient(client) - client.RegistryCredential = newRegistryCredentialClient(client) - client.ResourceDefinition = newResourceDefinitionClient(client) - client.RestartPolicy = newRestartPolicyClient(client) - client.RestoreFromBackupInput = newRestoreFromBackupInputClient(client) - client.RevertToSnapshotInput = newRevertToSnapshotInputClient(client) - client.RollingRestartStrategy = newRollingRestartStrategyClient(client) - client.ScalePolicy = newScalePolicyClient(client) - client.ScheduledUpgrade = newScheduledUpgradeClient(client) - client.SecondaryLaunchConfig = newSecondaryLaunchConfigClient(client) - client.Secret = newSecretClient(client) - client.SecretReference = newSecretReferenceClient(client) - client.Service = newServiceClient(client) - client.ServiceBinding = newServiceBindingClient(client) - client.ServiceConsumeMap = newServiceConsumeMapClient(client) - client.ServiceEvent = newServiceEventClient(client) - client.ServiceExposeMap = newServiceExposeMapClient(client) - client.ServiceLink = newServiceLinkClient(client) - client.ServiceLog = newServiceLogClient(client) - client.ServiceProxy = newServiceProxyClient(client) - client.ServiceRestart = newServiceRestartClient(client) - client.ServiceUpgrade = newServiceUpgradeClient(client) - client.ServiceUpgradeStrategy = newServiceUpgradeStrategyClient(client) - client.ServicesPortRange = newServicesPortRangeClient(client) - client.SetProjectMembersInput = newSetProjectMembersInputClient(client) - client.SetServiceLinksInput = newSetServiceLinksInputClient(client) - client.Setting = newSettingClient(client) - client.Snapshot = newSnapshotClient(client) - client.SnapshotBackupInput = newSnapshotBackupInputClient(client) - client.Stack = newStackClient(client) - client.StackUpgrade = newStackUpgradeClient(client) - client.StateTransition = newStateTransitionClient(client) - client.StatsAccess = newStatsAccessClient(client) - client.StorageDriver = newStorageDriverClient(client) - client.StorageDriverService = newStorageDriverServiceClient(client) - client.StoragePool = newStoragePoolClient(client) - client.Subnet = newSubnetClient(client) - client.TargetPortRule = newTargetPortRuleClient(client) - client.Task = newTaskClient(client) - client.TaskInstance = newTaskInstanceClient(client) - client.ToServiceUpgradeStrategy = newToServiceUpgradeStrategyClient(client) - client.TypeDocumentation = newTypeDocumentationClient(client) - client.Ulimit = newUlimitClient(client) - client.UserPreference = newUserPreferenceClient(client) - client.VirtualMachine = newVirtualMachineClient(client) - client.VirtualMachineDisk = newVirtualMachineDiskClient(client) - client.Volume = newVolumeClient(client) - client.VolumeActivateInput = newVolumeActivateInputClient(client) - client.VolumeSnapshotInput = newVolumeSnapshotInputClient(client) - client.VolumeTemplate = newVolumeTemplateClient(client) - - return client -} - -func NewRancherClient(opts *ClientOpts) (*RancherClient, error) { - rancherBaseClient := &RancherBaseClientImpl{ - Types: map[string]Schema{}, - } - client := constructClient(rancherBaseClient) - - err := setupRancherBaseClient(rancherBaseClient, opts) - if err != nil { - return nil, err - } - - return client, nil -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go b/vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go deleted file mode 100644 index f584863..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - CLUSTER_MEMBERSHIP_TYPE = "clusterMembership" -) - -type ClusterMembership struct { - Resource - - Clustered bool `json:"clustered,omitempty" yaml:"clustered,omitempty"` - - Config string `json:"config,omitempty" yaml:"config,omitempty"` - - Heartbeat int64 `json:"heartbeat,omitempty" yaml:"heartbeat,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ClusterMembershipCollection struct { - Collection - Data []ClusterMembership `json:"data,omitempty"` - client *ClusterMembershipClient -} - -type ClusterMembershipClient struct { - rancherClient *RancherClient -} - -type ClusterMembershipOperations interface { - List(opts *ListOpts) (*ClusterMembershipCollection, error) - Create(opts *ClusterMembership) (*ClusterMembership, error) - Update(existing *ClusterMembership, updates interface{}) (*ClusterMembership, error) - ById(id string) (*ClusterMembership, error) - Delete(container *ClusterMembership) error -} - -func newClusterMembershipClient(rancherClient *RancherClient) *ClusterMembershipClient { - return &ClusterMembershipClient{ - rancherClient: rancherClient, - } -} - -func (c *ClusterMembershipClient) Create(container *ClusterMembership) (*ClusterMembership, error) { - resp := &ClusterMembership{} - err := c.rancherClient.doCreate(CLUSTER_MEMBERSHIP_TYPE, container, resp) - return resp, err -} - -func (c *ClusterMembershipClient) Update(existing *ClusterMembership, updates interface{}) (*ClusterMembership, error) { - resp := &ClusterMembership{} - err := c.rancherClient.doUpdate(CLUSTER_MEMBERSHIP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterMembershipClient) List(opts *ListOpts) (*ClusterMembershipCollection, error) { - resp := &ClusterMembershipCollection{} - err := c.rancherClient.doList(CLUSTER_MEMBERSHIP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ClusterMembershipCollection) Next() (*ClusterMembershipCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterMembershipCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterMembershipClient) ById(id string) (*ClusterMembership, error) { - resp := &ClusterMembership{} - err := c.rancherClient.doById(CLUSTER_MEMBERSHIP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ClusterMembershipClient) Delete(container *ClusterMembership) error { - return c.rancherClient.doResourceDelete(CLUSTER_MEMBERSHIP_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go deleted file mode 100644 index b9bc013..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - COMPOSE_CONFIG_TYPE = "composeConfig" -) - -type ComposeConfig struct { - Resource - - DockerComposeConfig string `json:"dockerComposeConfig,omitempty" yaml:"docker_compose_config,omitempty"` - - RancherComposeConfig string `json:"rancherComposeConfig,omitempty" yaml:"rancher_compose_config,omitempty"` -} - -type ComposeConfigCollection struct { - Collection - Data []ComposeConfig `json:"data,omitempty"` - client *ComposeConfigClient -} - -type ComposeConfigClient struct { - rancherClient *RancherClient -} - -type ComposeConfigOperations interface { - List(opts *ListOpts) (*ComposeConfigCollection, error) - Create(opts *ComposeConfig) (*ComposeConfig, error) - Update(existing *ComposeConfig, updates interface{}) (*ComposeConfig, error) - ById(id string) (*ComposeConfig, error) - Delete(container *ComposeConfig) error -} - -func newComposeConfigClient(rancherClient *RancherClient) *ComposeConfigClient { - return &ComposeConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *ComposeConfigClient) Create(container *ComposeConfig) (*ComposeConfig, error) { - resp := &ComposeConfig{} - err := c.rancherClient.doCreate(COMPOSE_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *ComposeConfigClient) Update(existing *ComposeConfig, updates interface{}) (*ComposeConfig, error) { - resp := &ComposeConfig{} - err := c.rancherClient.doUpdate(COMPOSE_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ComposeConfigClient) List(opts *ListOpts) (*ComposeConfigCollection, error) { - resp := &ComposeConfigCollection{} - err := c.rancherClient.doList(COMPOSE_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ComposeConfigCollection) Next() (*ComposeConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ComposeConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ComposeConfigClient) ById(id string) (*ComposeConfig, error) { - resp := &ComposeConfig{} - err := c.rancherClient.doById(COMPOSE_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ComposeConfigClient) Delete(container *ComposeConfig) error { - return c.rancherClient.doResourceDelete(COMPOSE_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go deleted file mode 100644 index 3d03d92..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - COMPOSE_CONFIG_INPUT_TYPE = "composeConfigInput" -) - -type ComposeConfigInput struct { - Resource - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` -} - -type ComposeConfigInputCollection struct { - Collection - Data []ComposeConfigInput `json:"data,omitempty"` - client *ComposeConfigInputClient -} - -type ComposeConfigInputClient struct { - rancherClient *RancherClient -} - -type ComposeConfigInputOperations interface { - List(opts *ListOpts) (*ComposeConfigInputCollection, error) - Create(opts *ComposeConfigInput) (*ComposeConfigInput, error) - Update(existing *ComposeConfigInput, updates interface{}) (*ComposeConfigInput, error) - ById(id string) (*ComposeConfigInput, error) - Delete(container *ComposeConfigInput) error -} - -func newComposeConfigInputClient(rancherClient *RancherClient) *ComposeConfigInputClient { - return &ComposeConfigInputClient{ - rancherClient: rancherClient, - } -} - -func (c *ComposeConfigInputClient) Create(container *ComposeConfigInput) (*ComposeConfigInput, error) { - resp := &ComposeConfigInput{} - err := c.rancherClient.doCreate(COMPOSE_CONFIG_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *ComposeConfigInputClient) Update(existing *ComposeConfigInput, updates interface{}) (*ComposeConfigInput, error) { - resp := &ComposeConfigInput{} - err := c.rancherClient.doUpdate(COMPOSE_CONFIG_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ComposeConfigInputClient) List(opts *ListOpts) (*ComposeConfigInputCollection, error) { - resp := &ComposeConfigInputCollection{} - err := c.rancherClient.doList(COMPOSE_CONFIG_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ComposeConfigInputCollection) Next() (*ComposeConfigInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ComposeConfigInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ComposeConfigInputClient) ById(id string) (*ComposeConfigInput, error) { - resp := &ComposeConfigInput{} - err := c.rancherClient.doById(COMPOSE_CONFIG_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ComposeConfigInputClient) Delete(container *ComposeConfigInput) error { - return c.rancherClient.doResourceDelete(COMPOSE_CONFIG_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go deleted file mode 100644 index b191a88..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go +++ /dev/null @@ -1,191 +0,0 @@ -package client - -const ( - COMPOSE_PROJECT_TYPE = "composeProject" -) - -type ComposeProject struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` - - Binding *Binding `json:"binding,omitempty" yaml:"binding,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Group string `json:"group,omitempty" yaml:"group,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PreviousEnvironment map[string]interface{} `json:"previousEnvironment,omitempty" yaml:"previous_environment,omitempty"` - - PreviousExternalId string `json:"previousExternalId,omitempty" yaml:"previous_external_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ComposeProjectCollection struct { - Collection - Data []ComposeProject `json:"data,omitempty"` - client *ComposeProjectClient -} - -type ComposeProjectClient struct { - rancherClient *RancherClient -} - -type ComposeProjectOperations interface { - List(opts *ListOpts) (*ComposeProjectCollection, error) - Create(opts *ComposeProject) (*ComposeProject, error) - Update(existing *ComposeProject, updates interface{}) (*ComposeProject, error) - ById(id string) (*ComposeProject, error) - Delete(container *ComposeProject) error - - ActionCancelupgrade(*ComposeProject) (*Stack, error) - - ActionCreate(*ComposeProject) (*Stack, error) - - ActionError(*ComposeProject) (*Stack, error) - - ActionFinishupgrade(*ComposeProject) (*Stack, error) - - ActionRemove(*ComposeProject) (*Stack, error) - - ActionRollback(*ComposeProject) (*Stack, error) -} - -func newComposeProjectClient(rancherClient *RancherClient) *ComposeProjectClient { - return &ComposeProjectClient{ - rancherClient: rancherClient, - } -} - -func (c *ComposeProjectClient) Create(container *ComposeProject) (*ComposeProject, error) { - resp := &ComposeProject{} - err := c.rancherClient.doCreate(COMPOSE_PROJECT_TYPE, container, resp) - return resp, err -} - -func (c *ComposeProjectClient) Update(existing *ComposeProject, updates interface{}) (*ComposeProject, error) { - resp := &ComposeProject{} - err := c.rancherClient.doUpdate(COMPOSE_PROJECT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ComposeProjectClient) List(opts *ListOpts) (*ComposeProjectCollection, error) { - resp := &ComposeProjectCollection{} - err := c.rancherClient.doList(COMPOSE_PROJECT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ComposeProjectCollection) Next() (*ComposeProjectCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ComposeProjectCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ComposeProjectClient) ById(id string) (*ComposeProject, error) { - resp := &ComposeProject{} - err := c.rancherClient.doById(COMPOSE_PROJECT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ComposeProjectClient) Delete(container *ComposeProject) error { - return c.rancherClient.doResourceDelete(COMPOSE_PROJECT_TYPE, &container.Resource) -} - -func (c *ComposeProjectClient) ActionCancelupgrade(resource *ComposeProject) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeProjectClient) ActionCreate(resource *ComposeProject) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeProjectClient) ActionError(resource *ComposeProject) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeProjectClient) ActionFinishupgrade(resource *ComposeProject) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeProjectClient) ActionRemove(resource *ComposeProject) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeProjectClient) ActionRollback(resource *ComposeProject) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go deleted file mode 100644 index ca7a297..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go +++ /dev/null @@ -1,212 +0,0 @@ -package client - -const ( - COMPOSE_SERVICE_TYPE = "composeService" -) - -type ComposeService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` - - ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` - - SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` - - SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` -} - -type ComposeServiceCollection struct { - Collection - Data []ComposeService `json:"data,omitempty"` - client *ComposeServiceClient -} - -type ComposeServiceClient struct { - rancherClient *RancherClient -} - -type ComposeServiceOperations interface { - List(opts *ListOpts) (*ComposeServiceCollection, error) - Create(opts *ComposeService) (*ComposeService, error) - Update(existing *ComposeService, updates interface{}) (*ComposeService, error) - ById(id string) (*ComposeService, error) - Delete(container *ComposeService) error - - ActionActivate(*ComposeService) (*Service, error) - - ActionCancelupgrade(*ComposeService) (*Service, error) - - ActionContinueupgrade(*ComposeService) (*Service, error) - - ActionCreate(*ComposeService) (*Service, error) - - ActionFinishupgrade(*ComposeService) (*Service, error) - - ActionRemove(*ComposeService) (*Service, error) - - ActionRollback(*ComposeService) (*Service, error) -} - -func newComposeServiceClient(rancherClient *RancherClient) *ComposeServiceClient { - return &ComposeServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *ComposeServiceClient) Create(container *ComposeService) (*ComposeService, error) { - resp := &ComposeService{} - err := c.rancherClient.doCreate(COMPOSE_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *ComposeServiceClient) Update(existing *ComposeService, updates interface{}) (*ComposeService, error) { - resp := &ComposeService{} - err := c.rancherClient.doUpdate(COMPOSE_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ComposeServiceClient) List(opts *ListOpts) (*ComposeServiceCollection, error) { - resp := &ComposeServiceCollection{} - err := c.rancherClient.doList(COMPOSE_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ComposeServiceCollection) Next() (*ComposeServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ComposeServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ComposeServiceClient) ById(id string) (*ComposeService, error) { - resp := &ComposeService{} - err := c.rancherClient.doById(COMPOSE_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ComposeServiceClient) Delete(container *ComposeService) error { - return c.rancherClient.doResourceDelete(COMPOSE_SERVICE_TYPE, &container.Resource) -} - -func (c *ComposeServiceClient) ActionActivate(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeServiceClient) ActionCancelupgrade(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeServiceClient) ActionContinueupgrade(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeServiceClient) ActionCreate(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeServiceClient) ActionFinishupgrade(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeServiceClient) ActionRemove(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeServiceClient) ActionRollback(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_config_item.go b/vendor/github.com/rancher/go-rancher/v2/generated_config_item.go deleted file mode 100644 index b973066..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_config_item.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - CONFIG_ITEM_TYPE = "configItem" -) - -type ConfigItem struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - SourceVersion string `json:"sourceVersion,omitempty" yaml:"source_version,omitempty"` -} - -type ConfigItemCollection struct { - Collection - Data []ConfigItem `json:"data,omitempty"` - client *ConfigItemClient -} - -type ConfigItemClient struct { - rancherClient *RancherClient -} - -type ConfigItemOperations interface { - List(opts *ListOpts) (*ConfigItemCollection, error) - Create(opts *ConfigItem) (*ConfigItem, error) - Update(existing *ConfigItem, updates interface{}) (*ConfigItem, error) - ById(id string) (*ConfigItem, error) - Delete(container *ConfigItem) error -} - -func newConfigItemClient(rancherClient *RancherClient) *ConfigItemClient { - return &ConfigItemClient{ - rancherClient: rancherClient, - } -} - -func (c *ConfigItemClient) Create(container *ConfigItem) (*ConfigItem, error) { - resp := &ConfigItem{} - err := c.rancherClient.doCreate(CONFIG_ITEM_TYPE, container, resp) - return resp, err -} - -func (c *ConfigItemClient) Update(existing *ConfigItem, updates interface{}) (*ConfigItem, error) { - resp := &ConfigItem{} - err := c.rancherClient.doUpdate(CONFIG_ITEM_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ConfigItemClient) List(opts *ListOpts) (*ConfigItemCollection, error) { - resp := &ConfigItemCollection{} - err := c.rancherClient.doList(CONFIG_ITEM_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ConfigItemCollection) Next() (*ConfigItemCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ConfigItemCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ConfigItemClient) ById(id string) (*ConfigItem, error) { - resp := &ConfigItem{} - err := c.rancherClient.doById(CONFIG_ITEM_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ConfigItemClient) Delete(container *ConfigItem) error { - return c.rancherClient.doResourceDelete(CONFIG_ITEM_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go b/vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go deleted file mode 100644 index 2ce32ca..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go +++ /dev/null @@ -1,93 +0,0 @@ -package client - -const ( - CONFIG_ITEM_STATUS_TYPE = "configItemStatus" -) - -type ConfigItemStatus struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - AppliedUpdated string `json:"appliedUpdated,omitempty" yaml:"applied_updated,omitempty"` - - AppliedVersion int64 `json:"appliedVersion,omitempty" yaml:"applied_version,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RequestedUpdated string `json:"requestedUpdated,omitempty" yaml:"requested_updated,omitempty"` - - RequestedVersion int64 `json:"requestedVersion,omitempty" yaml:"requested_version,omitempty"` - - SourceVersion string `json:"sourceVersion,omitempty" yaml:"source_version,omitempty"` -} - -type ConfigItemStatusCollection struct { - Collection - Data []ConfigItemStatus `json:"data,omitempty"` - client *ConfigItemStatusClient -} - -type ConfigItemStatusClient struct { - rancherClient *RancherClient -} - -type ConfigItemStatusOperations interface { - List(opts *ListOpts) (*ConfigItemStatusCollection, error) - Create(opts *ConfigItemStatus) (*ConfigItemStatus, error) - Update(existing *ConfigItemStatus, updates interface{}) (*ConfigItemStatus, error) - ById(id string) (*ConfigItemStatus, error) - Delete(container *ConfigItemStatus) error -} - -func newConfigItemStatusClient(rancherClient *RancherClient) *ConfigItemStatusClient { - return &ConfigItemStatusClient{ - rancherClient: rancherClient, - } -} - -func (c *ConfigItemStatusClient) Create(container *ConfigItemStatus) (*ConfigItemStatus, error) { - resp := &ConfigItemStatus{} - err := c.rancherClient.doCreate(CONFIG_ITEM_STATUS_TYPE, container, resp) - return resp, err -} - -func (c *ConfigItemStatusClient) Update(existing *ConfigItemStatus, updates interface{}) (*ConfigItemStatus, error) { - resp := &ConfigItemStatus{} - err := c.rancherClient.doUpdate(CONFIG_ITEM_STATUS_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ConfigItemStatusClient) List(opts *ListOpts) (*ConfigItemStatusCollection, error) { - resp := &ConfigItemStatusCollection{} - err := c.rancherClient.doList(CONFIG_ITEM_STATUS_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ConfigItemStatusCollection) Next() (*ConfigItemStatusCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ConfigItemStatusCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ConfigItemStatusClient) ById(id string) (*ConfigItemStatus, error) { - resp := &ConfigItemStatus{} - err := c.rancherClient.doById(CONFIG_ITEM_STATUS_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ConfigItemStatusClient) Delete(container *ConfigItemStatus) error { - return c.rancherClient.doResourceDelete(CONFIG_ITEM_STATUS_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container.go b/vendor/github.com/rancher/go-rancher/v2/generated_container.go deleted file mode 100644 index 4cdf2a4..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_container.go +++ /dev/null @@ -1,517 +0,0 @@ -package client - -const ( - CONTAINER_TYPE = "container" -) - -type Container struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - AllocationState string `json:"allocationState,omitempty" yaml:"allocation_state,omitempty"` - - BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` - - BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,omitempty"` - - Build *DockerBuild `json:"build,omitempty" yaml:"build,omitempty"` - - CapAdd []string `json:"capAdd,omitempty" yaml:"cap_add,omitempty"` - - CapDrop []string `json:"capDrop,omitempty" yaml:"cap_drop,omitempty"` - - CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` - - Command []string `json:"command,omitempty" yaml:"command,omitempty"` - - Count int64 `json:"count,omitempty" yaml:"count,omitempty"` - - CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` - - CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` - - CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` - - CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` - - CpuRealtimePeriod int64 `json:"cpuRealtimePeriod,omitempty" yaml:"cpu_realtime_period,omitempty"` - - CpuRealtimeRuntime int64 `json:"cpuRealtimeRuntime,omitempty" yaml:"cpu_realtime_runtime,omitempty"` - - CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` - - CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` - - CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DataVolumeMounts map[string]interface{} `json:"dataVolumeMounts,omitempty" yaml:"data_volume_mounts,omitempty"` - - DataVolumes []string `json:"dataVolumes,omitempty" yaml:"data_volumes,omitempty"` - - DataVolumesFrom []string `json:"dataVolumesFrom,omitempty" yaml:"data_volumes_from,omitempty"` - - DeploymentUnitUuid string `json:"deploymentUnitUuid,omitempty" yaml:"deployment_unit_uuid,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` - - DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` - - Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` - - DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` - - DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` - - EntryPoint []string `json:"entryPoint,omitempty" yaml:"entry_point,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - Expose []string `json:"expose,omitempty" yaml:"expose,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExtraHosts []string `json:"extraHosts,omitempty" yaml:"extra_hosts,omitempty"` - - FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` - - GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` - - HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` - - HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` - - HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` - - HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - ImageUuid string `json:"imageUuid,omitempty" yaml:"image_uuid,omitempty"` - - InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` - - InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` - - IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` - - IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` - - Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` - - Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` - - IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` - - Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` - - KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - LogConfig *LogConfig `json:"logConfig,omitempty" yaml:"log_config,omitempty"` - - LxcConf map[string]interface{} `json:"lxcConf,omitempty" yaml:"lxc_conf,omitempty"` - - Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` - - MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` - - MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` - - MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` - - MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` - - Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` - - NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` - - NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` - - NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` - - NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` - - OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` - - OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` - - PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` - - PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` - - PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` - - Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` - - PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` - - ReadOnly bool `json:"readOnly,omitempty" yaml:"read_only,omitempty"` - - RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RequestedHostId string `json:"requestedHostId,omitempty" yaml:"requested_host_id,omitempty"` - - RestartPolicy *RestartPolicy `json:"restartPolicy,omitempty" yaml:"restart_policy,omitempty"` - - RunInit bool `json:"runInit,omitempty" yaml:"run_init,omitempty"` - - Secrets []SecretReference `json:"secrets,omitempty" yaml:"secrets,omitempty"` - - SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` - - StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` - - StopTimeout int64 `json:"stopTimeout,omitempty" yaml:"stop_timeout,omitempty"` - - StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` - - Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` - - Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` - - User string `json:"user,omitempty" yaml:"user,omitempty"` - - UserPorts []string `json:"userPorts,omitempty" yaml:"user_ports,omitempty"` - - UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` - - Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` - - VolumeDriver string `json:"volumeDriver,omitempty" yaml:"volume_driver,omitempty"` - - WorkingDir string `json:"workingDir,omitempty" yaml:"working_dir,omitempty"` -} - -type ContainerCollection struct { - Collection - Data []Container `json:"data,omitempty"` - client *ContainerClient -} - -type ContainerClient struct { - rancherClient *RancherClient -} - -type ContainerOperations interface { - List(opts *ListOpts) (*ContainerCollection, error) - Create(opts *Container) (*Container, error) - Update(existing *Container, updates interface{}) (*Container, error) - ById(id string) (*Container, error) - Delete(container *Container) error - - ActionAllocate(*Container) (*Instance, error) - - ActionConsole(*Container, *InstanceConsoleInput) (*InstanceConsole, error) - - ActionCreate(*Container) (*Instance, error) - - ActionDeallocate(*Container) (*Instance, error) - - ActionError(*Container) (*Instance, error) - - ActionExecute(*Container, *ContainerExec) (*HostAccess, error) - - ActionLogs(*Container, *ContainerLogs) (*HostAccess, error) - - ActionMigrate(*Container) (*Instance, error) - - ActionProxy(*Container, *ContainerProxy) (*HostAccess, error) - - ActionPurge(*Container) (*Instance, error) - - ActionRemove(*Container) (*Instance, error) - - ActionRestart(*Container) (*Instance, error) - - ActionStart(*Container) (*Instance, error) - - ActionStop(*Container, *InstanceStop) (*Instance, error) - - ActionUpdate(*Container) (*Instance, error) - - ActionUpdatehealthy(*Container) (*Instance, error) - - ActionUpdatereinitializing(*Container) (*Instance, error) - - ActionUpdateunhealthy(*Container) (*Instance, error) -} - -func newContainerClient(rancherClient *RancherClient) *ContainerClient { - return &ContainerClient{ - rancherClient: rancherClient, - } -} - -func (c *ContainerClient) Create(container *Container) (*Container, error) { - resp := &Container{} - err := c.rancherClient.doCreate(CONTAINER_TYPE, container, resp) - return resp, err -} - -func (c *ContainerClient) Update(existing *Container, updates interface{}) (*Container, error) { - resp := &Container{} - err := c.rancherClient.doUpdate(CONTAINER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ContainerClient) List(opts *ListOpts) (*ContainerCollection, error) { - resp := &ContainerCollection{} - err := c.rancherClient.doList(CONTAINER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ContainerCollection) Next() (*ContainerCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ContainerCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ContainerClient) ById(id string) (*Container, error) { - resp := &Container{} - err := c.rancherClient.doById(CONTAINER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ContainerClient) Delete(container *Container) error { - return c.rancherClient.doResourceDelete(CONTAINER_TYPE, &container.Resource) -} - -func (c *ContainerClient) ActionAllocate(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "allocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionConsole(resource *Container, input *InstanceConsoleInput) (*InstanceConsole, error) { - - resp := &InstanceConsole{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "console", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ContainerClient) ActionCreate(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionDeallocate(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "deallocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionError(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionExecute(resource *Container, input *ContainerExec) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "execute", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ContainerClient) ActionLogs(resource *Container, input *ContainerLogs) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "logs", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ContainerClient) ActionMigrate(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "migrate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionProxy(resource *Container, input *ContainerProxy) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "proxy", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ContainerClient) ActionPurge(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionRemove(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionRestart(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "restart", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionStart(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "start", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionStop(resource *Container, input *InstanceStop) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "stop", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ContainerClient) ActionUpdate(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionUpdatehealthy(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "updatehealthy", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionUpdatereinitializing(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "updatereinitializing", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionUpdateunhealthy(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "updateunhealthy", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_event.go deleted file mode 100644 index 8b95651..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_container_event.go +++ /dev/null @@ -1,129 +0,0 @@ -package client - -const ( - CONTAINER_EVENT_TYPE = "containerEvent" -) - -type ContainerEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DockerInspect interface{} `json:"dockerInspect,omitempty" yaml:"docker_inspect,omitempty"` - - ExternalFrom string `json:"externalFrom,omitempty" yaml:"external_from,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExternalStatus string `json:"externalStatus,omitempty" yaml:"external_status,omitempty"` - - ExternalTimestamp int64 `json:"externalTimestamp,omitempty" yaml:"external_timestamp,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedHostUuid string `json:"reportedHostUuid,omitempty" yaml:"reported_host_uuid,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` -} - -type ContainerEventCollection struct { - Collection - Data []ContainerEvent `json:"data,omitempty"` - client *ContainerEventClient -} - -type ContainerEventClient struct { - rancherClient *RancherClient -} - -type ContainerEventOperations interface { - List(opts *ListOpts) (*ContainerEventCollection, error) - Create(opts *ContainerEvent) (*ContainerEvent, error) - Update(existing *ContainerEvent, updates interface{}) (*ContainerEvent, error) - ById(id string) (*ContainerEvent, error) - Delete(container *ContainerEvent) error - - ActionCreate(*ContainerEvent) (*ContainerEvent, error) - - ActionRemove(*ContainerEvent) (*ContainerEvent, error) -} - -func newContainerEventClient(rancherClient *RancherClient) *ContainerEventClient { - return &ContainerEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ContainerEventClient) Create(container *ContainerEvent) (*ContainerEvent, error) { - resp := &ContainerEvent{} - err := c.rancherClient.doCreate(CONTAINER_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ContainerEventClient) Update(existing *ContainerEvent, updates interface{}) (*ContainerEvent, error) { - resp := &ContainerEvent{} - err := c.rancherClient.doUpdate(CONTAINER_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ContainerEventClient) List(opts *ListOpts) (*ContainerEventCollection, error) { - resp := &ContainerEventCollection{} - err := c.rancherClient.doList(CONTAINER_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ContainerEventCollection) Next() (*ContainerEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ContainerEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ContainerEventClient) ById(id string) (*ContainerEvent, error) { - resp := &ContainerEvent{} - err := c.rancherClient.doById(CONTAINER_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ContainerEventClient) Delete(container *ContainerEvent) error { - return c.rancherClient.doResourceDelete(CONTAINER_EVENT_TYPE, &container.Resource) -} - -func (c *ContainerEventClient) ActionCreate(resource *ContainerEvent) (*ContainerEvent, error) { - - resp := &ContainerEvent{} - - err := c.rancherClient.doAction(CONTAINER_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerEventClient) ActionRemove(resource *ContainerEvent) (*ContainerEvent, error) { - - resp := &ContainerEvent{} - - err := c.rancherClient.doAction(CONTAINER_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go deleted file mode 100644 index 196199b..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -const ( - CONTAINER_EXEC_TYPE = "containerExec" -) - -type ContainerExec struct { - Resource - - AttachStdin bool `json:"attachStdin,omitempty" yaml:"attach_stdin,omitempty"` - - AttachStdout bool `json:"attachStdout,omitempty" yaml:"attach_stdout,omitempty"` - - Command []string `json:"command,omitempty" yaml:"command,omitempty"` - - Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` -} - -type ContainerExecCollection struct { - Collection - Data []ContainerExec `json:"data,omitempty"` - client *ContainerExecClient -} - -type ContainerExecClient struct { - rancherClient *RancherClient -} - -type ContainerExecOperations interface { - List(opts *ListOpts) (*ContainerExecCollection, error) - Create(opts *ContainerExec) (*ContainerExec, error) - Update(existing *ContainerExec, updates interface{}) (*ContainerExec, error) - ById(id string) (*ContainerExec, error) - Delete(container *ContainerExec) error -} - -func newContainerExecClient(rancherClient *RancherClient) *ContainerExecClient { - return &ContainerExecClient{ - rancherClient: rancherClient, - } -} - -func (c *ContainerExecClient) Create(container *ContainerExec) (*ContainerExec, error) { - resp := &ContainerExec{} - err := c.rancherClient.doCreate(CONTAINER_EXEC_TYPE, container, resp) - return resp, err -} - -func (c *ContainerExecClient) Update(existing *ContainerExec, updates interface{}) (*ContainerExec, error) { - resp := &ContainerExec{} - err := c.rancherClient.doUpdate(CONTAINER_EXEC_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ContainerExecClient) List(opts *ListOpts) (*ContainerExecCollection, error) { - resp := &ContainerExecCollection{} - err := c.rancherClient.doList(CONTAINER_EXEC_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ContainerExecCollection) Next() (*ContainerExecCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ContainerExecCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ContainerExecClient) ById(id string) (*ContainerExec, error) { - resp := &ContainerExec{} - err := c.rancherClient.doById(CONTAINER_EXEC_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ContainerExecClient) Delete(container *ContainerExec) error { - return c.rancherClient.doResourceDelete(CONTAINER_EXEC_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go deleted file mode 100644 index 2149df1..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - CONTAINER_LOGS_TYPE = "containerLogs" -) - -type ContainerLogs struct { - Resource - - Follow bool `json:"follow,omitempty" yaml:"follow,omitempty"` - - Lines int64 `json:"lines,omitempty" yaml:"lines,omitempty"` -} - -type ContainerLogsCollection struct { - Collection - Data []ContainerLogs `json:"data,omitempty"` - client *ContainerLogsClient -} - -type ContainerLogsClient struct { - rancherClient *RancherClient -} - -type ContainerLogsOperations interface { - List(opts *ListOpts) (*ContainerLogsCollection, error) - Create(opts *ContainerLogs) (*ContainerLogs, error) - Update(existing *ContainerLogs, updates interface{}) (*ContainerLogs, error) - ById(id string) (*ContainerLogs, error) - Delete(container *ContainerLogs) error -} - -func newContainerLogsClient(rancherClient *RancherClient) *ContainerLogsClient { - return &ContainerLogsClient{ - rancherClient: rancherClient, - } -} - -func (c *ContainerLogsClient) Create(container *ContainerLogs) (*ContainerLogs, error) { - resp := &ContainerLogs{} - err := c.rancherClient.doCreate(CONTAINER_LOGS_TYPE, container, resp) - return resp, err -} - -func (c *ContainerLogsClient) Update(existing *ContainerLogs, updates interface{}) (*ContainerLogs, error) { - resp := &ContainerLogs{} - err := c.rancherClient.doUpdate(CONTAINER_LOGS_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ContainerLogsClient) List(opts *ListOpts) (*ContainerLogsCollection, error) { - resp := &ContainerLogsCollection{} - err := c.rancherClient.doList(CONTAINER_LOGS_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ContainerLogsCollection) Next() (*ContainerLogsCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ContainerLogsCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ContainerLogsClient) ById(id string) (*ContainerLogs, error) { - resp := &ContainerLogs{} - err := c.rancherClient.doById(CONTAINER_LOGS_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ContainerLogsClient) Delete(container *ContainerLogs) error { - return c.rancherClient.doResourceDelete(CONTAINER_LOGS_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go deleted file mode 100644 index 84d7670..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - CONTAINER_PROXY_TYPE = "containerProxy" -) - -type ContainerProxy struct { - Resource - - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - - Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"` -} - -type ContainerProxyCollection struct { - Collection - Data []ContainerProxy `json:"data,omitempty"` - client *ContainerProxyClient -} - -type ContainerProxyClient struct { - rancherClient *RancherClient -} - -type ContainerProxyOperations interface { - List(opts *ListOpts) (*ContainerProxyCollection, error) - Create(opts *ContainerProxy) (*ContainerProxy, error) - Update(existing *ContainerProxy, updates interface{}) (*ContainerProxy, error) - ById(id string) (*ContainerProxy, error) - Delete(container *ContainerProxy) error -} - -func newContainerProxyClient(rancherClient *RancherClient) *ContainerProxyClient { - return &ContainerProxyClient{ - rancherClient: rancherClient, - } -} - -func (c *ContainerProxyClient) Create(container *ContainerProxy) (*ContainerProxy, error) { - resp := &ContainerProxy{} - err := c.rancherClient.doCreate(CONTAINER_PROXY_TYPE, container, resp) - return resp, err -} - -func (c *ContainerProxyClient) Update(existing *ContainerProxy, updates interface{}) (*ContainerProxy, error) { - resp := &ContainerProxy{} - err := c.rancherClient.doUpdate(CONTAINER_PROXY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ContainerProxyClient) List(opts *ListOpts) (*ContainerProxyCollection, error) { - resp := &ContainerProxyCollection{} - err := c.rancherClient.doList(CONTAINER_PROXY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ContainerProxyCollection) Next() (*ContainerProxyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ContainerProxyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ContainerProxyClient) ById(id string) (*ContainerProxy, error) { - resp := &ContainerProxy{} - err := c.rancherClient.doById(CONTAINER_PROXY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ContainerProxyClient) Delete(container *ContainerProxy) error { - return c.rancherClient.doResourceDelete(CONTAINER_PROXY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_credential.go b/vendor/github.com/rancher/go-rancher/v2/generated_credential.go deleted file mode 100644 index f34a563..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_credential.go +++ /dev/null @@ -1,173 +0,0 @@ -package client - -const ( - CREDENTIAL_TYPE = "credential" -) - -type Credential struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicValue string `json:"publicValue,omitempty" yaml:"public_value,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SecretValue string `json:"secretValue,omitempty" yaml:"secret_value,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type CredentialCollection struct { - Collection - Data []Credential `json:"data,omitempty"` - client *CredentialClient -} - -type CredentialClient struct { - rancherClient *RancherClient -} - -type CredentialOperations interface { - List(opts *ListOpts) (*CredentialCollection, error) - Create(opts *Credential) (*Credential, error) - Update(existing *Credential, updates interface{}) (*Credential, error) - ById(id string) (*Credential, error) - Delete(container *Credential) error - - ActionActivate(*Credential) (*Credential, error) - - ActionCreate(*Credential) (*Credential, error) - - ActionDeactivate(*Credential) (*Credential, error) - - ActionPurge(*Credential) (*Credential, error) - - ActionRemove(*Credential) (*Credential, error) - - ActionUpdate(*Credential) (*Credential, error) -} - -func newCredentialClient(rancherClient *RancherClient) *CredentialClient { - return &CredentialClient{ - rancherClient: rancherClient, - } -} - -func (c *CredentialClient) Create(container *Credential) (*Credential, error) { - resp := &Credential{} - err := c.rancherClient.doCreate(CREDENTIAL_TYPE, container, resp) - return resp, err -} - -func (c *CredentialClient) Update(existing *Credential, updates interface{}) (*Credential, error) { - resp := &Credential{} - err := c.rancherClient.doUpdate(CREDENTIAL_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *CredentialClient) List(opts *ListOpts) (*CredentialCollection, error) { - resp := &CredentialCollection{} - err := c.rancherClient.doList(CREDENTIAL_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *CredentialCollection) Next() (*CredentialCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &CredentialCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *CredentialClient) ById(id string) (*Credential, error) { - resp := &Credential{} - err := c.rancherClient.doById(CREDENTIAL_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *CredentialClient) Delete(container *Credential) error { - return c.rancherClient.doResourceDelete(CREDENTIAL_TYPE, &container.Resource) -} - -func (c *CredentialClient) ActionActivate(resource *Credential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(CREDENTIAL_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CredentialClient) ActionCreate(resource *Credential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(CREDENTIAL_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CredentialClient) ActionDeactivate(resource *Credential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(CREDENTIAL_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CredentialClient) ActionPurge(resource *Credential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(CREDENTIAL_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CredentialClient) ActionRemove(resource *Credential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(CREDENTIAL_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CredentialClient) ActionUpdate(resource *Credential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(CREDENTIAL_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go deleted file mode 100644 index 0d935f8..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go +++ /dev/null @@ -1,97 +0,0 @@ -package client - -const ( - DATABASECHANGELOG_TYPE = "databasechangelog" -) - -type Databasechangelog struct { - Resource - - Author string `json:"author,omitempty" yaml:"author,omitempty"` - - Comments string `json:"comments,omitempty" yaml:"comments,omitempty"` - - Dateexecuted string `json:"dateexecuted,omitempty" yaml:"dateexecuted,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Exectype string `json:"exectype,omitempty" yaml:"exectype,omitempty"` - - Filename string `json:"filename,omitempty" yaml:"filename,omitempty"` - - Liquibase string `json:"liquibase,omitempty" yaml:"liquibase,omitempty"` - - Md5sum string `json:"md5sum,omitempty" yaml:"md5sum,omitempty"` - - Orderexecuted int64 `json:"orderexecuted,omitempty" yaml:"orderexecuted,omitempty"` - - Tag string `json:"tag,omitempty" yaml:"tag,omitempty"` -} - -type DatabasechangelogCollection struct { - Collection - Data []Databasechangelog `json:"data,omitempty"` - client *DatabasechangelogClient -} - -type DatabasechangelogClient struct { - rancherClient *RancherClient -} - -type DatabasechangelogOperations interface { - List(opts *ListOpts) (*DatabasechangelogCollection, error) - Create(opts *Databasechangelog) (*Databasechangelog, error) - Update(existing *Databasechangelog, updates interface{}) (*Databasechangelog, error) - ById(id string) (*Databasechangelog, error) - Delete(container *Databasechangelog) error -} - -func newDatabasechangelogClient(rancherClient *RancherClient) *DatabasechangelogClient { - return &DatabasechangelogClient{ - rancherClient: rancherClient, - } -} - -func (c *DatabasechangelogClient) Create(container *Databasechangelog) (*Databasechangelog, error) { - resp := &Databasechangelog{} - err := c.rancherClient.doCreate(DATABASECHANGELOG_TYPE, container, resp) - return resp, err -} - -func (c *DatabasechangelogClient) Update(existing *Databasechangelog, updates interface{}) (*Databasechangelog, error) { - resp := &Databasechangelog{} - err := c.rancherClient.doUpdate(DATABASECHANGELOG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DatabasechangelogClient) List(opts *ListOpts) (*DatabasechangelogCollection, error) { - resp := &DatabasechangelogCollection{} - err := c.rancherClient.doList(DATABASECHANGELOG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *DatabasechangelogCollection) Next() (*DatabasechangelogCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DatabasechangelogCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DatabasechangelogClient) ById(id string) (*Databasechangelog, error) { - resp := &Databasechangelog{} - err := c.rancherClient.doById(DATABASECHANGELOG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *DatabasechangelogClient) Delete(container *Databasechangelog) error { - return c.rancherClient.doResourceDelete(DATABASECHANGELOG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go deleted file mode 100644 index a93c015..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - DATABASECHANGELOGLOCK_TYPE = "databasechangeloglock" -) - -type Databasechangeloglock struct { - Resource - - Locked bool `json:"locked,omitempty" yaml:"locked,omitempty"` - - Lockedby string `json:"lockedby,omitempty" yaml:"lockedby,omitempty"` - - Lockgranted string `json:"lockgranted,omitempty" yaml:"lockgranted,omitempty"` -} - -type DatabasechangeloglockCollection struct { - Collection - Data []Databasechangeloglock `json:"data,omitempty"` - client *DatabasechangeloglockClient -} - -type DatabasechangeloglockClient struct { - rancherClient *RancherClient -} - -type DatabasechangeloglockOperations interface { - List(opts *ListOpts) (*DatabasechangeloglockCollection, error) - Create(opts *Databasechangeloglock) (*Databasechangeloglock, error) - Update(existing *Databasechangeloglock, updates interface{}) (*Databasechangeloglock, error) - ById(id string) (*Databasechangeloglock, error) - Delete(container *Databasechangeloglock) error -} - -func newDatabasechangeloglockClient(rancherClient *RancherClient) *DatabasechangeloglockClient { - return &DatabasechangeloglockClient{ - rancherClient: rancherClient, - } -} - -func (c *DatabasechangeloglockClient) Create(container *Databasechangeloglock) (*Databasechangeloglock, error) { - resp := &Databasechangeloglock{} - err := c.rancherClient.doCreate(DATABASECHANGELOGLOCK_TYPE, container, resp) - return resp, err -} - -func (c *DatabasechangeloglockClient) Update(existing *Databasechangeloglock, updates interface{}) (*Databasechangeloglock, error) { - resp := &Databasechangeloglock{} - err := c.rancherClient.doUpdate(DATABASECHANGELOGLOCK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DatabasechangeloglockClient) List(opts *ListOpts) (*DatabasechangeloglockCollection, error) { - resp := &DatabasechangeloglockCollection{} - err := c.rancherClient.doList(DATABASECHANGELOGLOCK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *DatabasechangeloglockCollection) Next() (*DatabasechangeloglockCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DatabasechangeloglockCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DatabasechangeloglockClient) ById(id string) (*Databasechangeloglock, error) { - resp := &Databasechangeloglock{} - err := c.rancherClient.doById(DATABASECHANGELOGLOCK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *DatabasechangeloglockClient) Delete(container *Databasechangeloglock) error { - return c.rancherClient.doResourceDelete(DATABASECHANGELOGLOCK_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_default_network.go b/vendor/github.com/rancher/go-rancher/v2/generated_default_network.go deleted file mode 100644 index 8cdb206..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_default_network.go +++ /dev/null @@ -1,183 +0,0 @@ -package client - -const ( - DEFAULT_NETWORK_TYPE = "defaultNetwork" -) - -type DefaultNetwork struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DefaultPolicyAction string `json:"defaultPolicyAction,omitempty" yaml:"default_policy_action,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` - - HostPorts bool `json:"hostPorts,omitempty" yaml:"host_ports,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Policy []NetworkPolicyRule `json:"policy,omitempty" yaml:"policy,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Subnets []Subnet `json:"subnets,omitempty" yaml:"subnets,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type DefaultNetworkCollection struct { - Collection - Data []DefaultNetwork `json:"data,omitempty"` - client *DefaultNetworkClient -} - -type DefaultNetworkClient struct { - rancherClient *RancherClient -} - -type DefaultNetworkOperations interface { - List(opts *ListOpts) (*DefaultNetworkCollection, error) - Create(opts *DefaultNetwork) (*DefaultNetwork, error) - Update(existing *DefaultNetwork, updates interface{}) (*DefaultNetwork, error) - ById(id string) (*DefaultNetwork, error) - Delete(container *DefaultNetwork) error - - ActionActivate(*DefaultNetwork) (*Network, error) - - ActionCreate(*DefaultNetwork) (*Network, error) - - ActionDeactivate(*DefaultNetwork) (*Network, error) - - ActionPurge(*DefaultNetwork) (*Network, error) - - ActionRemove(*DefaultNetwork) (*Network, error) - - ActionUpdate(*DefaultNetwork) (*Network, error) -} - -func newDefaultNetworkClient(rancherClient *RancherClient) *DefaultNetworkClient { - return &DefaultNetworkClient{ - rancherClient: rancherClient, - } -} - -func (c *DefaultNetworkClient) Create(container *DefaultNetwork) (*DefaultNetwork, error) { - resp := &DefaultNetwork{} - err := c.rancherClient.doCreate(DEFAULT_NETWORK_TYPE, container, resp) - return resp, err -} - -func (c *DefaultNetworkClient) Update(existing *DefaultNetwork, updates interface{}) (*DefaultNetwork, error) { - resp := &DefaultNetwork{} - err := c.rancherClient.doUpdate(DEFAULT_NETWORK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DefaultNetworkClient) List(opts *ListOpts) (*DefaultNetworkCollection, error) { - resp := &DefaultNetworkCollection{} - err := c.rancherClient.doList(DEFAULT_NETWORK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *DefaultNetworkCollection) Next() (*DefaultNetworkCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DefaultNetworkCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DefaultNetworkClient) ById(id string) (*DefaultNetwork, error) { - resp := &DefaultNetwork{} - err := c.rancherClient.doById(DEFAULT_NETWORK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *DefaultNetworkClient) Delete(container *DefaultNetwork) error { - return c.rancherClient.doResourceDelete(DEFAULT_NETWORK_TYPE, &container.Resource) -} - -func (c *DefaultNetworkClient) ActionActivate(resource *DefaultNetwork) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DefaultNetworkClient) ActionCreate(resource *DefaultNetwork) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DefaultNetworkClient) ActionDeactivate(resource *DefaultNetwork) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DefaultNetworkClient) ActionPurge(resource *DefaultNetwork) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DefaultNetworkClient) ActionRemove(resource *DefaultNetwork) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DefaultNetworkClient) ActionUpdate(resource *DefaultNetwork) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go deleted file mode 100644 index b03c8a0..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go +++ /dev/null @@ -1,101 +0,0 @@ -package client - -const ( - DIGITALOCEAN_CONFIG_TYPE = "digitaloceanConfig" -) - -type DigitaloceanConfig struct { - Resource - - AccessToken string `json:"accessToken,omitempty" yaml:"access_token,omitempty"` - - Backups bool `json:"backups,omitempty" yaml:"backups,omitempty"` - - Image string `json:"image,omitempty" yaml:"image,omitempty"` - - Ipv6 bool `json:"ipv6,omitempty" yaml:"ipv6,omitempty"` - - PrivateNetworking bool `json:"privateNetworking,omitempty" yaml:"private_networking,omitempty"` - - Region string `json:"region,omitempty" yaml:"region,omitempty"` - - Size string `json:"size,omitempty" yaml:"size,omitempty"` - - SshKeyFingerprint string `json:"sshKeyFingerprint,omitempty" yaml:"ssh_key_fingerprint,omitempty"` - - SshKeyPath string `json:"sshKeyPath,omitempty" yaml:"ssh_key_path,omitempty"` - - SshPort string `json:"sshPort,omitempty" yaml:"ssh_port,omitempty"` - - SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` - - Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` -} - -type DigitaloceanConfigCollection struct { - Collection - Data []DigitaloceanConfig `json:"data,omitempty"` - client *DigitaloceanConfigClient -} - -type DigitaloceanConfigClient struct { - rancherClient *RancherClient -} - -type DigitaloceanConfigOperations interface { - List(opts *ListOpts) (*DigitaloceanConfigCollection, error) - Create(opts *DigitaloceanConfig) (*DigitaloceanConfig, error) - Update(existing *DigitaloceanConfig, updates interface{}) (*DigitaloceanConfig, error) - ById(id string) (*DigitaloceanConfig, error) - Delete(container *DigitaloceanConfig) error -} - -func newDigitaloceanConfigClient(rancherClient *RancherClient) *DigitaloceanConfigClient { - return &DigitaloceanConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *DigitaloceanConfigClient) Create(container *DigitaloceanConfig) (*DigitaloceanConfig, error) { - resp := &DigitaloceanConfig{} - err := c.rancherClient.doCreate(DIGITALOCEAN_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *DigitaloceanConfigClient) Update(existing *DigitaloceanConfig, updates interface{}) (*DigitaloceanConfig, error) { - resp := &DigitaloceanConfig{} - err := c.rancherClient.doUpdate(DIGITALOCEAN_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DigitaloceanConfigClient) List(opts *ListOpts) (*DigitaloceanConfigCollection, error) { - resp := &DigitaloceanConfigCollection{} - err := c.rancherClient.doList(DIGITALOCEAN_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *DigitaloceanConfigCollection) Next() (*DigitaloceanConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DigitaloceanConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DigitaloceanConfigClient) ById(id string) (*DigitaloceanConfig, error) { - resp := &DigitaloceanConfig{} - err := c.rancherClient.doById(DIGITALOCEAN_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *DigitaloceanConfigClient) Delete(container *DigitaloceanConfig) error { - return c.rancherClient.doResourceDelete(DIGITALOCEAN_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go deleted file mode 100644 index d554562..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go +++ /dev/null @@ -1,285 +0,0 @@ -package client - -const ( - DNS_SERVICE_TYPE = "dnsService" -) - -type DnsService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` - - SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type DnsServiceCollection struct { - Collection - Data []DnsService `json:"data,omitempty"` - client *DnsServiceClient -} - -type DnsServiceClient struct { - rancherClient *RancherClient -} - -type DnsServiceOperations interface { - List(opts *ListOpts) (*DnsServiceCollection, error) - Create(opts *DnsService) (*DnsService, error) - Update(existing *DnsService, updates interface{}) (*DnsService, error) - ById(id string) (*DnsService, error) - Delete(container *DnsService) error - - ActionActivate(*DnsService) (*Service, error) - - ActionAddservicelink(*DnsService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionCancelupgrade(*DnsService) (*Service, error) - - ActionContinueupgrade(*DnsService) (*Service, error) - - ActionCreate(*DnsService) (*Service, error) - - ActionDeactivate(*DnsService) (*Service, error) - - ActionFinishupgrade(*DnsService) (*Service, error) - - ActionRemove(*DnsService) (*Service, error) - - ActionRemoveservicelink(*DnsService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionRestart(*DnsService, *ServiceRestart) (*Service, error) - - ActionRollback(*DnsService) (*Service, error) - - ActionSetservicelinks(*DnsService, *SetServiceLinksInput) (*Service, error) - - ActionUpdate(*DnsService) (*Service, error) - - ActionUpgrade(*DnsService, *ServiceUpgrade) (*Service, error) -} - -func newDnsServiceClient(rancherClient *RancherClient) *DnsServiceClient { - return &DnsServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *DnsServiceClient) Create(container *DnsService) (*DnsService, error) { - resp := &DnsService{} - err := c.rancherClient.doCreate(DNS_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *DnsServiceClient) Update(existing *DnsService, updates interface{}) (*DnsService, error) { - resp := &DnsService{} - err := c.rancherClient.doUpdate(DNS_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DnsServiceClient) List(opts *ListOpts) (*DnsServiceCollection, error) { - resp := &DnsServiceCollection{} - err := c.rancherClient.doList(DNS_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *DnsServiceCollection) Next() (*DnsServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DnsServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DnsServiceClient) ById(id string) (*DnsService, error) { - resp := &DnsService{} - err := c.rancherClient.doById(DNS_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *DnsServiceClient) Delete(container *DnsService) error { - return c.rancherClient.doResourceDelete(DNS_SERVICE_TYPE, &container.Resource) -} - -func (c *DnsServiceClient) ActionActivate(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionAddservicelink(resource *DnsService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionCancelupgrade(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionContinueupgrade(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionCreate(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionDeactivate(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionFinishupgrade(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionRemove(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionRemoveservicelink(resource *DnsService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionRestart(resource *DnsService, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionRollback(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionSetservicelinks(resource *DnsService, input *SetServiceLinksInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionUpdate(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionUpgrade(resource *DnsService, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go b/vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go deleted file mode 100644 index a1b1e37..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go +++ /dev/null @@ -1,89 +0,0 @@ -package client - -const ( - DOCKER_BUILD_TYPE = "dockerBuild" -) - -type DockerBuild struct { - Resource - - Context string `json:"context,omitempty" yaml:"context,omitempty"` - - Dockerfile string `json:"dockerfile,omitempty" yaml:"dockerfile,omitempty"` - - Forcerm bool `json:"forcerm,omitempty" yaml:"forcerm,omitempty"` - - Nocache bool `json:"nocache,omitempty" yaml:"nocache,omitempty"` - - Remote string `json:"remote,omitempty" yaml:"remote,omitempty"` - - Rm bool `json:"rm,omitempty" yaml:"rm,omitempty"` -} - -type DockerBuildCollection struct { - Collection - Data []DockerBuild `json:"data,omitempty"` - client *DockerBuildClient -} - -type DockerBuildClient struct { - rancherClient *RancherClient -} - -type DockerBuildOperations interface { - List(opts *ListOpts) (*DockerBuildCollection, error) - Create(opts *DockerBuild) (*DockerBuild, error) - Update(existing *DockerBuild, updates interface{}) (*DockerBuild, error) - ById(id string) (*DockerBuild, error) - Delete(container *DockerBuild) error -} - -func newDockerBuildClient(rancherClient *RancherClient) *DockerBuildClient { - return &DockerBuildClient{ - rancherClient: rancherClient, - } -} - -func (c *DockerBuildClient) Create(container *DockerBuild) (*DockerBuild, error) { - resp := &DockerBuild{} - err := c.rancherClient.doCreate(DOCKER_BUILD_TYPE, container, resp) - return resp, err -} - -func (c *DockerBuildClient) Update(existing *DockerBuild, updates interface{}) (*DockerBuild, error) { - resp := &DockerBuild{} - err := c.rancherClient.doUpdate(DOCKER_BUILD_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DockerBuildClient) List(opts *ListOpts) (*DockerBuildCollection, error) { - resp := &DockerBuildCollection{} - err := c.rancherClient.doList(DOCKER_BUILD_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *DockerBuildCollection) Next() (*DockerBuildCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DockerBuildCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DockerBuildClient) ById(id string) (*DockerBuild, error) { - resp := &DockerBuild{} - err := c.rancherClient.doById(DOCKER_BUILD_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *DockerBuildClient) Delete(container *DockerBuild) error { - return c.rancherClient.doResourceDelete(DOCKER_BUILD_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go b/vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go deleted file mode 100644 index 2163833..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - EXTENSION_IMPLEMENTATION_TYPE = "extensionImplementation" -) - -type ExtensionImplementation struct { - Resource - - ClassName string `json:"className,omitempty" yaml:"class_name,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Properties map[string]interface{} `json:"properties,omitempty" yaml:"properties,omitempty"` -} - -type ExtensionImplementationCollection struct { - Collection - Data []ExtensionImplementation `json:"data,omitempty"` - client *ExtensionImplementationClient -} - -type ExtensionImplementationClient struct { - rancherClient *RancherClient -} - -type ExtensionImplementationOperations interface { - List(opts *ListOpts) (*ExtensionImplementationCollection, error) - Create(opts *ExtensionImplementation) (*ExtensionImplementation, error) - Update(existing *ExtensionImplementation, updates interface{}) (*ExtensionImplementation, error) - ById(id string) (*ExtensionImplementation, error) - Delete(container *ExtensionImplementation) error -} - -func newExtensionImplementationClient(rancherClient *RancherClient) *ExtensionImplementationClient { - return &ExtensionImplementationClient{ - rancherClient: rancherClient, - } -} - -func (c *ExtensionImplementationClient) Create(container *ExtensionImplementation) (*ExtensionImplementation, error) { - resp := &ExtensionImplementation{} - err := c.rancherClient.doCreate(EXTENSION_IMPLEMENTATION_TYPE, container, resp) - return resp, err -} - -func (c *ExtensionImplementationClient) Update(existing *ExtensionImplementation, updates interface{}) (*ExtensionImplementation, error) { - resp := &ExtensionImplementation{} - err := c.rancherClient.doUpdate(EXTENSION_IMPLEMENTATION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExtensionImplementationClient) List(opts *ListOpts) (*ExtensionImplementationCollection, error) { - resp := &ExtensionImplementationCollection{} - err := c.rancherClient.doList(EXTENSION_IMPLEMENTATION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExtensionImplementationCollection) Next() (*ExtensionImplementationCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExtensionImplementationCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExtensionImplementationClient) ById(id string) (*ExtensionImplementation, error) { - resp := &ExtensionImplementation{} - err := c.rancherClient.doById(EXTENSION_IMPLEMENTATION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExtensionImplementationClient) Delete(container *ExtensionImplementation) error { - return c.rancherClient.doResourceDelete(EXTENSION_IMPLEMENTATION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go b/vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go deleted file mode 100644 index e3c0b87..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - EXTENSION_POINT_TYPE = "extensionPoint" -) - -type ExtensionPoint struct { - Resource - - ExcludeSetting string `json:"excludeSetting,omitempty" yaml:"exclude_setting,omitempty"` - - Implementations []ExtensionImplementation `json:"implementations,omitempty" yaml:"implementations,omitempty"` - - IncludeSetting string `json:"includeSetting,omitempty" yaml:"include_setting,omitempty"` - - ListSetting string `json:"listSetting,omitempty" yaml:"list_setting,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} - -type ExtensionPointCollection struct { - Collection - Data []ExtensionPoint `json:"data,omitempty"` - client *ExtensionPointClient -} - -type ExtensionPointClient struct { - rancherClient *RancherClient -} - -type ExtensionPointOperations interface { - List(opts *ListOpts) (*ExtensionPointCollection, error) - Create(opts *ExtensionPoint) (*ExtensionPoint, error) - Update(existing *ExtensionPoint, updates interface{}) (*ExtensionPoint, error) - ById(id string) (*ExtensionPoint, error) - Delete(container *ExtensionPoint) error -} - -func newExtensionPointClient(rancherClient *RancherClient) *ExtensionPointClient { - return &ExtensionPointClient{ - rancherClient: rancherClient, - } -} - -func (c *ExtensionPointClient) Create(container *ExtensionPoint) (*ExtensionPoint, error) { - resp := &ExtensionPoint{} - err := c.rancherClient.doCreate(EXTENSION_POINT_TYPE, container, resp) - return resp, err -} - -func (c *ExtensionPointClient) Update(existing *ExtensionPoint, updates interface{}) (*ExtensionPoint, error) { - resp := &ExtensionPoint{} - err := c.rancherClient.doUpdate(EXTENSION_POINT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExtensionPointClient) List(opts *ListOpts) (*ExtensionPointCollection, error) { - resp := &ExtensionPointCollection{} - err := c.rancherClient.doList(EXTENSION_POINT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExtensionPointCollection) Next() (*ExtensionPointCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExtensionPointCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExtensionPointClient) ById(id string) (*ExtensionPoint, error) { - resp := &ExtensionPoint{} - err := c.rancherClient.doById(EXTENSION_POINT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExtensionPointClient) Delete(container *ExtensionPoint) error { - return c.rancherClient.doResourceDelete(EXTENSION_POINT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go deleted file mode 100644 index e4c6c92..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go +++ /dev/null @@ -1,129 +0,0 @@ -package client - -const ( - EXTERNAL_DNS_EVENT_TYPE = "externalDnsEvent" -) - -type ExternalDnsEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` - - ServiceName string `json:"serviceName,omitempty" yaml:"service_name,omitempty"` - - StackName string `json:"stackName,omitempty" yaml:"stack_name,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalDnsEventCollection struct { - Collection - Data []ExternalDnsEvent `json:"data,omitempty"` - client *ExternalDnsEventClient -} - -type ExternalDnsEventClient struct { - rancherClient *RancherClient -} - -type ExternalDnsEventOperations interface { - List(opts *ListOpts) (*ExternalDnsEventCollection, error) - Create(opts *ExternalDnsEvent) (*ExternalDnsEvent, error) - Update(existing *ExternalDnsEvent, updates interface{}) (*ExternalDnsEvent, error) - ById(id string) (*ExternalDnsEvent, error) - Delete(container *ExternalDnsEvent) error - - ActionCreate(*ExternalDnsEvent) (*ExternalEvent, error) - - ActionRemove(*ExternalDnsEvent) (*ExternalEvent, error) -} - -func newExternalDnsEventClient(rancherClient *RancherClient) *ExternalDnsEventClient { - return &ExternalDnsEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalDnsEventClient) Create(container *ExternalDnsEvent) (*ExternalDnsEvent, error) { - resp := &ExternalDnsEvent{} - err := c.rancherClient.doCreate(EXTERNAL_DNS_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ExternalDnsEventClient) Update(existing *ExternalDnsEvent, updates interface{}) (*ExternalDnsEvent, error) { - resp := &ExternalDnsEvent{} - err := c.rancherClient.doUpdate(EXTERNAL_DNS_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalDnsEventClient) List(opts *ListOpts) (*ExternalDnsEventCollection, error) { - resp := &ExternalDnsEventCollection{} - err := c.rancherClient.doList(EXTERNAL_DNS_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalDnsEventCollection) Next() (*ExternalDnsEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalDnsEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalDnsEventClient) ById(id string) (*ExternalDnsEvent, error) { - resp := &ExternalDnsEvent{} - err := c.rancherClient.doById(EXTERNAL_DNS_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalDnsEventClient) Delete(container *ExternalDnsEvent) error { - return c.rancherClient.doResourceDelete(EXTERNAL_DNS_EVENT_TYPE, &container.Resource) -} - -func (c *ExternalDnsEventClient) ActionCreate(resource *ExternalDnsEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_DNS_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalDnsEventClient) ActionRemove(resource *ExternalDnsEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_DNS_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_event.go deleted file mode 100644 index 3b43545..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_event.go +++ /dev/null @@ -1,123 +0,0 @@ -package client - -const ( - EXTERNAL_EVENT_TYPE = "externalEvent" -) - -type ExternalEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalEventCollection struct { - Collection - Data []ExternalEvent `json:"data,omitempty"` - client *ExternalEventClient -} - -type ExternalEventClient struct { - rancherClient *RancherClient -} - -type ExternalEventOperations interface { - List(opts *ListOpts) (*ExternalEventCollection, error) - Create(opts *ExternalEvent) (*ExternalEvent, error) - Update(existing *ExternalEvent, updates interface{}) (*ExternalEvent, error) - ById(id string) (*ExternalEvent, error) - Delete(container *ExternalEvent) error - - ActionCreate(*ExternalEvent) (*ExternalEvent, error) - - ActionRemove(*ExternalEvent) (*ExternalEvent, error) -} - -func newExternalEventClient(rancherClient *RancherClient) *ExternalEventClient { - return &ExternalEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalEventClient) Create(container *ExternalEvent) (*ExternalEvent, error) { - resp := &ExternalEvent{} - err := c.rancherClient.doCreate(EXTERNAL_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ExternalEventClient) Update(existing *ExternalEvent, updates interface{}) (*ExternalEvent, error) { - resp := &ExternalEvent{} - err := c.rancherClient.doUpdate(EXTERNAL_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalEventClient) List(opts *ListOpts) (*ExternalEventCollection, error) { - resp := &ExternalEventCollection{} - err := c.rancherClient.doList(EXTERNAL_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalEventCollection) Next() (*ExternalEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalEventClient) ById(id string) (*ExternalEvent, error) { - resp := &ExternalEvent{} - err := c.rancherClient.doById(EXTERNAL_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalEventClient) Delete(container *ExternalEvent) error { - return c.rancherClient.doResourceDelete(EXTERNAL_EVENT_TYPE, &container.Resource) -} - -func (c *ExternalEventClient) ActionCreate(resource *ExternalEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalEventClient) ActionRemove(resource *ExternalEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go deleted file mode 100644 index d016292..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go +++ /dev/null @@ -1,175 +0,0 @@ -package client - -const ( - EXTERNAL_HANDLER_TYPE = "externalHandler" -) - -type ExternalHandler struct { - Resource - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` - - ProcessConfigs []ExternalHandlerProcessConfig `json:"processConfigs,omitempty" yaml:"process_configs,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - Retries int64 `json:"retries,omitempty" yaml:"retries,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - TimeoutMillis int64 `json:"timeoutMillis,omitempty" yaml:"timeout_millis,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalHandlerCollection struct { - Collection - Data []ExternalHandler `json:"data,omitempty"` - client *ExternalHandlerClient -} - -type ExternalHandlerClient struct { - rancherClient *RancherClient -} - -type ExternalHandlerOperations interface { - List(opts *ListOpts) (*ExternalHandlerCollection, error) - Create(opts *ExternalHandler) (*ExternalHandler, error) - Update(existing *ExternalHandler, updates interface{}) (*ExternalHandler, error) - ById(id string) (*ExternalHandler, error) - Delete(container *ExternalHandler) error - - ActionActivate(*ExternalHandler) (*ExternalHandler, error) - - ActionCreate(*ExternalHandler) (*ExternalHandler, error) - - ActionDeactivate(*ExternalHandler) (*ExternalHandler, error) - - ActionPurge(*ExternalHandler) (*ExternalHandler, error) - - ActionRemove(*ExternalHandler) (*ExternalHandler, error) - - ActionUpdate(*ExternalHandler) (*ExternalHandler, error) -} - -func newExternalHandlerClient(rancherClient *RancherClient) *ExternalHandlerClient { - return &ExternalHandlerClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalHandlerClient) Create(container *ExternalHandler) (*ExternalHandler, error) { - resp := &ExternalHandler{} - err := c.rancherClient.doCreate(EXTERNAL_HANDLER_TYPE, container, resp) - return resp, err -} - -func (c *ExternalHandlerClient) Update(existing *ExternalHandler, updates interface{}) (*ExternalHandler, error) { - resp := &ExternalHandler{} - err := c.rancherClient.doUpdate(EXTERNAL_HANDLER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalHandlerClient) List(opts *ListOpts) (*ExternalHandlerCollection, error) { - resp := &ExternalHandlerCollection{} - err := c.rancherClient.doList(EXTERNAL_HANDLER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalHandlerCollection) Next() (*ExternalHandlerCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalHandlerCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalHandlerClient) ById(id string) (*ExternalHandler, error) { - resp := &ExternalHandler{} - err := c.rancherClient.doById(EXTERNAL_HANDLER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalHandlerClient) Delete(container *ExternalHandler) error { - return c.rancherClient.doResourceDelete(EXTERNAL_HANDLER_TYPE, &container.Resource) -} - -func (c *ExternalHandlerClient) ActionActivate(resource *ExternalHandler) (*ExternalHandler, error) { - - resp := &ExternalHandler{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerClient) ActionCreate(resource *ExternalHandler) (*ExternalHandler, error) { - - resp := &ExternalHandler{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerClient) ActionDeactivate(resource *ExternalHandler) (*ExternalHandler, error) { - - resp := &ExternalHandler{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerClient) ActionPurge(resource *ExternalHandler) (*ExternalHandler, error) { - - resp := &ExternalHandler{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerClient) ActionRemove(resource *ExternalHandler) (*ExternalHandler, error) { - - resp := &ExternalHandler{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerClient) ActionUpdate(resource *ExternalHandler) (*ExternalHandler, error) { - - resp := &ExternalHandler{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go deleted file mode 100644 index b111264..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go +++ /dev/null @@ -1,175 +0,0 @@ -package client - -const ( - EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE = "externalHandlerExternalHandlerProcessMap" -) - -type ExternalHandlerExternalHandlerProcessMap struct { - Resource - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - EventName string `json:"eventName,omitempty" yaml:"event_name,omitempty"` - - ExternalHandlerId string `json:"externalHandlerId,omitempty" yaml:"external_handler_id,omitempty"` - - ExternalHandlerProcessId string `json:"externalHandlerProcessId,omitempty" yaml:"external_handler_process_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - OnError string `json:"onError,omitempty" yaml:"on_error,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalHandlerExternalHandlerProcessMapCollection struct { - Collection - Data []ExternalHandlerExternalHandlerProcessMap `json:"data,omitempty"` - client *ExternalHandlerExternalHandlerProcessMapClient -} - -type ExternalHandlerExternalHandlerProcessMapClient struct { - rancherClient *RancherClient -} - -type ExternalHandlerExternalHandlerProcessMapOperations interface { - List(opts *ListOpts) (*ExternalHandlerExternalHandlerProcessMapCollection, error) - Create(opts *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - Update(existing *ExternalHandlerExternalHandlerProcessMap, updates interface{}) (*ExternalHandlerExternalHandlerProcessMap, error) - ById(id string) (*ExternalHandlerExternalHandlerProcessMap, error) - Delete(container *ExternalHandlerExternalHandlerProcessMap) error - - ActionActivate(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - - ActionCreate(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - - ActionDeactivate(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - - ActionPurge(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - - ActionRemove(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - - ActionUpdate(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) -} - -func newExternalHandlerExternalHandlerProcessMapClient(rancherClient *RancherClient) *ExternalHandlerExternalHandlerProcessMapClient { - return &ExternalHandlerExternalHandlerProcessMapClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) Create(container *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - resp := &ExternalHandlerExternalHandlerProcessMap{} - err := c.rancherClient.doCreate(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, container, resp) - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) Update(existing *ExternalHandlerExternalHandlerProcessMap, updates interface{}) (*ExternalHandlerExternalHandlerProcessMap, error) { - resp := &ExternalHandlerExternalHandlerProcessMap{} - err := c.rancherClient.doUpdate(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) List(opts *ListOpts) (*ExternalHandlerExternalHandlerProcessMapCollection, error) { - resp := &ExternalHandlerExternalHandlerProcessMapCollection{} - err := c.rancherClient.doList(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalHandlerExternalHandlerProcessMapCollection) Next() (*ExternalHandlerExternalHandlerProcessMapCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalHandlerExternalHandlerProcessMapCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ById(id string) (*ExternalHandlerExternalHandlerProcessMap, error) { - resp := &ExternalHandlerExternalHandlerProcessMap{} - err := c.rancherClient.doById(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) Delete(container *ExternalHandlerExternalHandlerProcessMap) error { - return c.rancherClient.doResourceDelete(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, &container.Resource) -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionActivate(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - - resp := &ExternalHandlerExternalHandlerProcessMap{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionCreate(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - - resp := &ExternalHandlerExternalHandlerProcessMap{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionDeactivate(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - - resp := &ExternalHandlerExternalHandlerProcessMap{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionPurge(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - - resp := &ExternalHandlerExternalHandlerProcessMap{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionRemove(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - - resp := &ExternalHandlerExternalHandlerProcessMap{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionUpdate(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - - resp := &ExternalHandlerExternalHandlerProcessMap{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go deleted file mode 100644 index c9aedf8..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go +++ /dev/null @@ -1,167 +0,0 @@ -package client - -const ( - EXTERNAL_HANDLER_PROCESS_TYPE = "externalHandlerProcess" -) - -type ExternalHandlerProcess struct { - Resource - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalHandlerProcessCollection struct { - Collection - Data []ExternalHandlerProcess `json:"data,omitempty"` - client *ExternalHandlerProcessClient -} - -type ExternalHandlerProcessClient struct { - rancherClient *RancherClient -} - -type ExternalHandlerProcessOperations interface { - List(opts *ListOpts) (*ExternalHandlerProcessCollection, error) - Create(opts *ExternalHandlerProcess) (*ExternalHandlerProcess, error) - Update(existing *ExternalHandlerProcess, updates interface{}) (*ExternalHandlerProcess, error) - ById(id string) (*ExternalHandlerProcess, error) - Delete(container *ExternalHandlerProcess) error - - ActionActivate(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) - - ActionCreate(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) - - ActionDeactivate(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) - - ActionPurge(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) - - ActionRemove(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) - - ActionUpdate(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) -} - -func newExternalHandlerProcessClient(rancherClient *RancherClient) *ExternalHandlerProcessClient { - return &ExternalHandlerProcessClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalHandlerProcessClient) Create(container *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - resp := &ExternalHandlerProcess{} - err := c.rancherClient.doCreate(EXTERNAL_HANDLER_PROCESS_TYPE, container, resp) - return resp, err -} - -func (c *ExternalHandlerProcessClient) Update(existing *ExternalHandlerProcess, updates interface{}) (*ExternalHandlerProcess, error) { - resp := &ExternalHandlerProcess{} - err := c.rancherClient.doUpdate(EXTERNAL_HANDLER_PROCESS_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalHandlerProcessClient) List(opts *ListOpts) (*ExternalHandlerProcessCollection, error) { - resp := &ExternalHandlerProcessCollection{} - err := c.rancherClient.doList(EXTERNAL_HANDLER_PROCESS_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalHandlerProcessCollection) Next() (*ExternalHandlerProcessCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalHandlerProcessCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalHandlerProcessClient) ById(id string) (*ExternalHandlerProcess, error) { - resp := &ExternalHandlerProcess{} - err := c.rancherClient.doById(EXTERNAL_HANDLER_PROCESS_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalHandlerProcessClient) Delete(container *ExternalHandlerProcess) error { - return c.rancherClient.doResourceDelete(EXTERNAL_HANDLER_PROCESS_TYPE, &container.Resource) -} - -func (c *ExternalHandlerProcessClient) ActionActivate(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - - resp := &ExternalHandlerProcess{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerProcessClient) ActionCreate(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - - resp := &ExternalHandlerProcess{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerProcessClient) ActionDeactivate(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - - resp := &ExternalHandlerProcess{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerProcessClient) ActionPurge(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - - resp := &ExternalHandlerProcess{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerProcessClient) ActionRemove(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - - resp := &ExternalHandlerProcess{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerProcessClient) ActionUpdate(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - - resp := &ExternalHandlerProcess{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go deleted file mode 100644 index 08d4ab0..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE = "externalHandlerProcessConfig" -) - -type ExternalHandlerProcessConfig struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - OnError string `json:"onError,omitempty" yaml:"on_error,omitempty"` -} - -type ExternalHandlerProcessConfigCollection struct { - Collection - Data []ExternalHandlerProcessConfig `json:"data,omitempty"` - client *ExternalHandlerProcessConfigClient -} - -type ExternalHandlerProcessConfigClient struct { - rancherClient *RancherClient -} - -type ExternalHandlerProcessConfigOperations interface { - List(opts *ListOpts) (*ExternalHandlerProcessConfigCollection, error) - Create(opts *ExternalHandlerProcessConfig) (*ExternalHandlerProcessConfig, error) - Update(existing *ExternalHandlerProcessConfig, updates interface{}) (*ExternalHandlerProcessConfig, error) - ById(id string) (*ExternalHandlerProcessConfig, error) - Delete(container *ExternalHandlerProcessConfig) error -} - -func newExternalHandlerProcessConfigClient(rancherClient *RancherClient) *ExternalHandlerProcessConfigClient { - return &ExternalHandlerProcessConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalHandlerProcessConfigClient) Create(container *ExternalHandlerProcessConfig) (*ExternalHandlerProcessConfig, error) { - resp := &ExternalHandlerProcessConfig{} - err := c.rancherClient.doCreate(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *ExternalHandlerProcessConfigClient) Update(existing *ExternalHandlerProcessConfig, updates interface{}) (*ExternalHandlerProcessConfig, error) { - resp := &ExternalHandlerProcessConfig{} - err := c.rancherClient.doUpdate(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalHandlerProcessConfigClient) List(opts *ListOpts) (*ExternalHandlerProcessConfigCollection, error) { - resp := &ExternalHandlerProcessConfigCollection{} - err := c.rancherClient.doList(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalHandlerProcessConfigCollection) Next() (*ExternalHandlerProcessConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalHandlerProcessConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalHandlerProcessConfigClient) ById(id string) (*ExternalHandlerProcessConfig, error) { - resp := &ExternalHandlerProcessConfig{} - err := c.rancherClient.doById(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalHandlerProcessConfigClient) Delete(container *ExternalHandlerProcessConfig) error { - return c.rancherClient.doResourceDelete(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go deleted file mode 100644 index e35425e..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go +++ /dev/null @@ -1,129 +0,0 @@ -package client - -const ( - EXTERNAL_HOST_EVENT_TYPE = "externalHostEvent" -) - -type ExternalHostEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DeleteHost bool `json:"deleteHost,omitempty" yaml:"delete_host,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - HostLabel string `json:"hostLabel,omitempty" yaml:"host_label,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalHostEventCollection struct { - Collection - Data []ExternalHostEvent `json:"data,omitempty"` - client *ExternalHostEventClient -} - -type ExternalHostEventClient struct { - rancherClient *RancherClient -} - -type ExternalHostEventOperations interface { - List(opts *ListOpts) (*ExternalHostEventCollection, error) - Create(opts *ExternalHostEvent) (*ExternalHostEvent, error) - Update(existing *ExternalHostEvent, updates interface{}) (*ExternalHostEvent, error) - ById(id string) (*ExternalHostEvent, error) - Delete(container *ExternalHostEvent) error - - ActionCreate(*ExternalHostEvent) (*ExternalEvent, error) - - ActionRemove(*ExternalHostEvent) (*ExternalEvent, error) -} - -func newExternalHostEventClient(rancherClient *RancherClient) *ExternalHostEventClient { - return &ExternalHostEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalHostEventClient) Create(container *ExternalHostEvent) (*ExternalHostEvent, error) { - resp := &ExternalHostEvent{} - err := c.rancherClient.doCreate(EXTERNAL_HOST_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ExternalHostEventClient) Update(existing *ExternalHostEvent, updates interface{}) (*ExternalHostEvent, error) { - resp := &ExternalHostEvent{} - err := c.rancherClient.doUpdate(EXTERNAL_HOST_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalHostEventClient) List(opts *ListOpts) (*ExternalHostEventCollection, error) { - resp := &ExternalHostEventCollection{} - err := c.rancherClient.doList(EXTERNAL_HOST_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalHostEventCollection) Next() (*ExternalHostEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalHostEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalHostEventClient) ById(id string) (*ExternalHostEvent, error) { - resp := &ExternalHostEvent{} - err := c.rancherClient.doById(EXTERNAL_HOST_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalHostEventClient) Delete(container *ExternalHostEvent) error { - return c.rancherClient.doResourceDelete(EXTERNAL_HOST_EVENT_TYPE, &container.Resource) -} - -func (c *ExternalHostEventClient) ActionCreate(resource *ExternalHostEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_HOST_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHostEventClient) ActionRemove(resource *ExternalHostEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_HOST_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_service.go deleted file mode 100644 index cc9cf4f..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_service.go +++ /dev/null @@ -1,252 +0,0 @@ -package client - -const ( - EXTERNAL_SERVICE_TYPE = "externalService" -) - -type ExternalService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExternalIpAddresses []string `json:"externalIpAddresses,omitempty" yaml:"external_ip_addresses,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalServiceCollection struct { - Collection - Data []ExternalService `json:"data,omitempty"` - client *ExternalServiceClient -} - -type ExternalServiceClient struct { - rancherClient *RancherClient -} - -type ExternalServiceOperations interface { - List(opts *ListOpts) (*ExternalServiceCollection, error) - Create(opts *ExternalService) (*ExternalService, error) - Update(existing *ExternalService, updates interface{}) (*ExternalService, error) - ById(id string) (*ExternalService, error) - Delete(container *ExternalService) error - - ActionActivate(*ExternalService) (*Service, error) - - ActionCancelupgrade(*ExternalService) (*Service, error) - - ActionContinueupgrade(*ExternalService) (*Service, error) - - ActionCreate(*ExternalService) (*Service, error) - - ActionDeactivate(*ExternalService) (*Service, error) - - ActionFinishupgrade(*ExternalService) (*Service, error) - - ActionRemove(*ExternalService) (*Service, error) - - ActionRestart(*ExternalService, *ServiceRestart) (*Service, error) - - ActionRollback(*ExternalService) (*Service, error) - - ActionUpdate(*ExternalService) (*Service, error) - - ActionUpgrade(*ExternalService, *ServiceUpgrade) (*Service, error) -} - -func newExternalServiceClient(rancherClient *RancherClient) *ExternalServiceClient { - return &ExternalServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalServiceClient) Create(container *ExternalService) (*ExternalService, error) { - resp := &ExternalService{} - err := c.rancherClient.doCreate(EXTERNAL_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *ExternalServiceClient) Update(existing *ExternalService, updates interface{}) (*ExternalService, error) { - resp := &ExternalService{} - err := c.rancherClient.doUpdate(EXTERNAL_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalServiceClient) List(opts *ListOpts) (*ExternalServiceCollection, error) { - resp := &ExternalServiceCollection{} - err := c.rancherClient.doList(EXTERNAL_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalServiceCollection) Next() (*ExternalServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalServiceClient) ById(id string) (*ExternalService, error) { - resp := &ExternalService{} - err := c.rancherClient.doById(EXTERNAL_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalServiceClient) Delete(container *ExternalService) error { - return c.rancherClient.doResourceDelete(EXTERNAL_SERVICE_TYPE, &container.Resource) -} - -func (c *ExternalServiceClient) ActionActivate(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionCancelupgrade(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionContinueupgrade(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionCreate(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionDeactivate(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionFinishupgrade(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionRemove(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionRestart(resource *ExternalService, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionRollback(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionUpdate(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionUpgrade(resource *ExternalService, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go deleted file mode 100644 index 59913d2..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go +++ /dev/null @@ -1,127 +0,0 @@ -package client - -const ( - EXTERNAL_SERVICE_EVENT_TYPE = "externalServiceEvent" -) - -type ExternalServiceEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Environment interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` - - Service interface{} `json:"service,omitempty" yaml:"service,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalServiceEventCollection struct { - Collection - Data []ExternalServiceEvent `json:"data,omitempty"` - client *ExternalServiceEventClient -} - -type ExternalServiceEventClient struct { - rancherClient *RancherClient -} - -type ExternalServiceEventOperations interface { - List(opts *ListOpts) (*ExternalServiceEventCollection, error) - Create(opts *ExternalServiceEvent) (*ExternalServiceEvent, error) - Update(existing *ExternalServiceEvent, updates interface{}) (*ExternalServiceEvent, error) - ById(id string) (*ExternalServiceEvent, error) - Delete(container *ExternalServiceEvent) error - - ActionCreate(*ExternalServiceEvent) (*ExternalEvent, error) - - ActionRemove(*ExternalServiceEvent) (*ExternalEvent, error) -} - -func newExternalServiceEventClient(rancherClient *RancherClient) *ExternalServiceEventClient { - return &ExternalServiceEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalServiceEventClient) Create(container *ExternalServiceEvent) (*ExternalServiceEvent, error) { - resp := &ExternalServiceEvent{} - err := c.rancherClient.doCreate(EXTERNAL_SERVICE_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ExternalServiceEventClient) Update(existing *ExternalServiceEvent, updates interface{}) (*ExternalServiceEvent, error) { - resp := &ExternalServiceEvent{} - err := c.rancherClient.doUpdate(EXTERNAL_SERVICE_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalServiceEventClient) List(opts *ListOpts) (*ExternalServiceEventCollection, error) { - resp := &ExternalServiceEventCollection{} - err := c.rancherClient.doList(EXTERNAL_SERVICE_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalServiceEventCollection) Next() (*ExternalServiceEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalServiceEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalServiceEventClient) ById(id string) (*ExternalServiceEvent, error) { - resp := &ExternalServiceEvent{} - err := c.rancherClient.doById(EXTERNAL_SERVICE_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalServiceEventClient) Delete(container *ExternalServiceEvent) error { - return c.rancherClient.doResourceDelete(EXTERNAL_SERVICE_EVENT_TYPE, &container.Resource) -} - -func (c *ExternalServiceEventClient) ActionCreate(resource *ExternalServiceEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceEventClient) ActionRemove(resource *ExternalServiceEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go deleted file mode 100644 index 30b8ca1..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go +++ /dev/null @@ -1,127 +0,0 @@ -package client - -const ( - EXTERNAL_STORAGE_POOL_EVENT_TYPE = "externalStoragePoolEvent" -) - -type ExternalStoragePoolEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HostUuids []string `json:"hostUuids,omitempty" yaml:"host_uuids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StoragePool StoragePool `json:"storagePool,omitempty" yaml:"storage_pool,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalStoragePoolEventCollection struct { - Collection - Data []ExternalStoragePoolEvent `json:"data,omitempty"` - client *ExternalStoragePoolEventClient -} - -type ExternalStoragePoolEventClient struct { - rancherClient *RancherClient -} - -type ExternalStoragePoolEventOperations interface { - List(opts *ListOpts) (*ExternalStoragePoolEventCollection, error) - Create(opts *ExternalStoragePoolEvent) (*ExternalStoragePoolEvent, error) - Update(existing *ExternalStoragePoolEvent, updates interface{}) (*ExternalStoragePoolEvent, error) - ById(id string) (*ExternalStoragePoolEvent, error) - Delete(container *ExternalStoragePoolEvent) error - - ActionCreate(*ExternalStoragePoolEvent) (*ExternalEvent, error) - - ActionRemove(*ExternalStoragePoolEvent) (*ExternalEvent, error) -} - -func newExternalStoragePoolEventClient(rancherClient *RancherClient) *ExternalStoragePoolEventClient { - return &ExternalStoragePoolEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalStoragePoolEventClient) Create(container *ExternalStoragePoolEvent) (*ExternalStoragePoolEvent, error) { - resp := &ExternalStoragePoolEvent{} - err := c.rancherClient.doCreate(EXTERNAL_STORAGE_POOL_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ExternalStoragePoolEventClient) Update(existing *ExternalStoragePoolEvent, updates interface{}) (*ExternalStoragePoolEvent, error) { - resp := &ExternalStoragePoolEvent{} - err := c.rancherClient.doUpdate(EXTERNAL_STORAGE_POOL_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalStoragePoolEventClient) List(opts *ListOpts) (*ExternalStoragePoolEventCollection, error) { - resp := &ExternalStoragePoolEventCollection{} - err := c.rancherClient.doList(EXTERNAL_STORAGE_POOL_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalStoragePoolEventCollection) Next() (*ExternalStoragePoolEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalStoragePoolEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalStoragePoolEventClient) ById(id string) (*ExternalStoragePoolEvent, error) { - resp := &ExternalStoragePoolEvent{} - err := c.rancherClient.doById(EXTERNAL_STORAGE_POOL_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalStoragePoolEventClient) Delete(container *ExternalStoragePoolEvent) error { - return c.rancherClient.doResourceDelete(EXTERNAL_STORAGE_POOL_EVENT_TYPE, &container.Resource) -} - -func (c *ExternalStoragePoolEventClient) ActionCreate(resource *ExternalStoragePoolEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_STORAGE_POOL_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalStoragePoolEventClient) ActionRemove(resource *ExternalStoragePoolEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_STORAGE_POOL_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go deleted file mode 100644 index 785efb1..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go +++ /dev/null @@ -1,125 +0,0 @@ -package client - -const ( - EXTERNAL_VOLUME_EVENT_TYPE = "externalVolumeEvent" -) - -type ExternalVolumeEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Volume Volume `json:"volume,omitempty" yaml:"volume,omitempty"` -} - -type ExternalVolumeEventCollection struct { - Collection - Data []ExternalVolumeEvent `json:"data,omitempty"` - client *ExternalVolumeEventClient -} - -type ExternalVolumeEventClient struct { - rancherClient *RancherClient -} - -type ExternalVolumeEventOperations interface { - List(opts *ListOpts) (*ExternalVolumeEventCollection, error) - Create(opts *ExternalVolumeEvent) (*ExternalVolumeEvent, error) - Update(existing *ExternalVolumeEvent, updates interface{}) (*ExternalVolumeEvent, error) - ById(id string) (*ExternalVolumeEvent, error) - Delete(container *ExternalVolumeEvent) error - - ActionCreate(*ExternalVolumeEvent) (*ExternalEvent, error) - - ActionRemove(*ExternalVolumeEvent) (*ExternalEvent, error) -} - -func newExternalVolumeEventClient(rancherClient *RancherClient) *ExternalVolumeEventClient { - return &ExternalVolumeEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalVolumeEventClient) Create(container *ExternalVolumeEvent) (*ExternalVolumeEvent, error) { - resp := &ExternalVolumeEvent{} - err := c.rancherClient.doCreate(EXTERNAL_VOLUME_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ExternalVolumeEventClient) Update(existing *ExternalVolumeEvent, updates interface{}) (*ExternalVolumeEvent, error) { - resp := &ExternalVolumeEvent{} - err := c.rancherClient.doUpdate(EXTERNAL_VOLUME_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalVolumeEventClient) List(opts *ListOpts) (*ExternalVolumeEventCollection, error) { - resp := &ExternalVolumeEventCollection{} - err := c.rancherClient.doList(EXTERNAL_VOLUME_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalVolumeEventCollection) Next() (*ExternalVolumeEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalVolumeEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalVolumeEventClient) ById(id string) (*ExternalVolumeEvent, error) { - resp := &ExternalVolumeEvent{} - err := c.rancherClient.doById(EXTERNAL_VOLUME_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalVolumeEventClient) Delete(container *ExternalVolumeEvent) error { - return c.rancherClient.doResourceDelete(EXTERNAL_VOLUME_EVENT_TYPE, &container.Resource) -} - -func (c *ExternalVolumeEventClient) ActionCreate(resource *ExternalVolumeEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_VOLUME_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalVolumeEventClient) ActionRemove(resource *ExternalVolumeEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_VOLUME_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go b/vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go deleted file mode 100644 index 511d33b..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - FIELD_DOCUMENTATION_TYPE = "fieldDocumentation" -) - -type FieldDocumentation struct { - Resource - - Description string `json:"description,omitempty" yaml:"description,omitempty"` -} - -type FieldDocumentationCollection struct { - Collection - Data []FieldDocumentation `json:"data,omitempty"` - client *FieldDocumentationClient -} - -type FieldDocumentationClient struct { - rancherClient *RancherClient -} - -type FieldDocumentationOperations interface { - List(opts *ListOpts) (*FieldDocumentationCollection, error) - Create(opts *FieldDocumentation) (*FieldDocumentation, error) - Update(existing *FieldDocumentation, updates interface{}) (*FieldDocumentation, error) - ById(id string) (*FieldDocumentation, error) - Delete(container *FieldDocumentation) error -} - -func newFieldDocumentationClient(rancherClient *RancherClient) *FieldDocumentationClient { - return &FieldDocumentationClient{ - rancherClient: rancherClient, - } -} - -func (c *FieldDocumentationClient) Create(container *FieldDocumentation) (*FieldDocumentation, error) { - resp := &FieldDocumentation{} - err := c.rancherClient.doCreate(FIELD_DOCUMENTATION_TYPE, container, resp) - return resp, err -} - -func (c *FieldDocumentationClient) Update(existing *FieldDocumentation, updates interface{}) (*FieldDocumentation, error) { - resp := &FieldDocumentation{} - err := c.rancherClient.doUpdate(FIELD_DOCUMENTATION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *FieldDocumentationClient) List(opts *ListOpts) (*FieldDocumentationCollection, error) { - resp := &FieldDocumentationCollection{} - err := c.rancherClient.doList(FIELD_DOCUMENTATION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *FieldDocumentationCollection) Next() (*FieldDocumentationCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &FieldDocumentationCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *FieldDocumentationClient) ById(id string) (*FieldDocumentation, error) { - resp := &FieldDocumentation{} - err := c.rancherClient.doById(FIELD_DOCUMENTATION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *FieldDocumentationClient) Delete(container *FieldDocumentation) error { - return c.rancherClient.doResourceDelete(FIELD_DOCUMENTATION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go b/vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go deleted file mode 100644 index 4cfd367..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go +++ /dev/null @@ -1,129 +0,0 @@ -package client - -const ( - GENERIC_OBJECT_TYPE = "genericObject" -) - -type GenericObject struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Key string `json:"key,omitempty" yaml:"key,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ResourceData map[string]interface{} `json:"resourceData,omitempty" yaml:"resource_data,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type GenericObjectCollection struct { - Collection - Data []GenericObject `json:"data,omitempty"` - client *GenericObjectClient -} - -type GenericObjectClient struct { - rancherClient *RancherClient -} - -type GenericObjectOperations interface { - List(opts *ListOpts) (*GenericObjectCollection, error) - Create(opts *GenericObject) (*GenericObject, error) - Update(existing *GenericObject, updates interface{}) (*GenericObject, error) - ById(id string) (*GenericObject, error) - Delete(container *GenericObject) error - - ActionCreate(*GenericObject) (*GenericObject, error) - - ActionRemove(*GenericObject) (*GenericObject, error) -} - -func newGenericObjectClient(rancherClient *RancherClient) *GenericObjectClient { - return &GenericObjectClient{ - rancherClient: rancherClient, - } -} - -func (c *GenericObjectClient) Create(container *GenericObject) (*GenericObject, error) { - resp := &GenericObject{} - err := c.rancherClient.doCreate(GENERIC_OBJECT_TYPE, container, resp) - return resp, err -} - -func (c *GenericObjectClient) Update(existing *GenericObject, updates interface{}) (*GenericObject, error) { - resp := &GenericObject{} - err := c.rancherClient.doUpdate(GENERIC_OBJECT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *GenericObjectClient) List(opts *ListOpts) (*GenericObjectCollection, error) { - resp := &GenericObjectCollection{} - err := c.rancherClient.doList(GENERIC_OBJECT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *GenericObjectCollection) Next() (*GenericObjectCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &GenericObjectCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *GenericObjectClient) ById(id string) (*GenericObject, error) { - resp := &GenericObject{} - err := c.rancherClient.doById(GENERIC_OBJECT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *GenericObjectClient) Delete(container *GenericObject) error { - return c.rancherClient.doResourceDelete(GENERIC_OBJECT_TYPE, &container.Resource) -} - -func (c *GenericObjectClient) ActionCreate(resource *GenericObject) (*GenericObject, error) { - - resp := &GenericObject{} - - err := c.rancherClient.doAction(GENERIC_OBJECT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *GenericObjectClient) ActionRemove(resource *GenericObject) (*GenericObject, error) { - - resp := &GenericObject{} - - err := c.rancherClient.doAction(GENERIC_OBJECT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go deleted file mode 100644 index f5bb82f..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -const ( - HA_CONFIG_TYPE = "haConfig" -) - -type HaConfig struct { - Resource - - ClusterSize int64 `json:"clusterSize,omitempty" yaml:"cluster_size,omitempty"` - - DbHost string `json:"dbHost,omitempty" yaml:"db_host,omitempty"` - - DbSize int64 `json:"dbSize,omitempty" yaml:"db_size,omitempty"` - - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` -} - -type HaConfigCollection struct { - Collection - Data []HaConfig `json:"data,omitempty"` - client *HaConfigClient -} - -type HaConfigClient struct { - rancherClient *RancherClient -} - -type HaConfigOperations interface { - List(opts *ListOpts) (*HaConfigCollection, error) - Create(opts *HaConfig) (*HaConfig, error) - Update(existing *HaConfig, updates interface{}) (*HaConfig, error) - ById(id string) (*HaConfig, error) - Delete(container *HaConfig) error -} - -func newHaConfigClient(rancherClient *RancherClient) *HaConfigClient { - return &HaConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *HaConfigClient) Create(container *HaConfig) (*HaConfig, error) { - resp := &HaConfig{} - err := c.rancherClient.doCreate(HA_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *HaConfigClient) Update(existing *HaConfig, updates interface{}) (*HaConfig, error) { - resp := &HaConfig{} - err := c.rancherClient.doUpdate(HA_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HaConfigClient) List(opts *ListOpts) (*HaConfigCollection, error) { - resp := &HaConfigCollection{} - err := c.rancherClient.doList(HA_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HaConfigCollection) Next() (*HaConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HaConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HaConfigClient) ById(id string) (*HaConfig, error) { - resp := &HaConfig{} - err := c.rancherClient.doById(HA_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HaConfigClient) Delete(container *HaConfig) error { - return c.rancherClient.doResourceDelete(HA_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go deleted file mode 100644 index ce86936..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go +++ /dev/null @@ -1,109 +0,0 @@ -package client - -const ( - HA_CONFIG_INPUT_TYPE = "haConfigInput" -) - -type HaConfigInput struct { - Resource - - Cert string `json:"cert,omitempty" yaml:"cert,omitempty"` - - CertChain string `json:"certChain,omitempty" yaml:"cert_chain,omitempty"` - - ClusterSize int64 `json:"clusterSize,omitempty" yaml:"cluster_size,omitempty"` - - HostRegistrationUrl string `json:"hostRegistrationUrl,omitempty" yaml:"host_registration_url,omitempty"` - - HttpEnabled bool `json:"httpEnabled,omitempty" yaml:"http_enabled,omitempty"` - - HttpPort int64 `json:"httpPort,omitempty" yaml:"http_port,omitempty"` - - HttpsPort int64 `json:"httpsPort,omitempty" yaml:"https_port,omitempty"` - - Key string `json:"key,omitempty" yaml:"key,omitempty"` - - PpHttpPort int64 `json:"ppHttpPort,omitempty" yaml:"pp_http_port,omitempty"` - - PpHttpsPort int64 `json:"ppHttpsPort,omitempty" yaml:"pp_https_port,omitempty"` - - RedisPort int64 `json:"redisPort,omitempty" yaml:"redis_port,omitempty"` - - SwarmEnabled bool `json:"swarmEnabled,omitempty" yaml:"swarm_enabled,omitempty"` - - SwarmPort int64 `json:"swarmPort,omitempty" yaml:"swarm_port,omitempty"` - - ZookeeperClientPort int64 `json:"zookeeperClientPort,omitempty" yaml:"zookeeper_client_port,omitempty"` - - ZookeeperLeaderPort int64 `json:"zookeeperLeaderPort,omitempty" yaml:"zookeeper_leader_port,omitempty"` - - ZookeeperQuorumPort int64 `json:"zookeeperQuorumPort,omitempty" yaml:"zookeeper_quorum_port,omitempty"` -} - -type HaConfigInputCollection struct { - Collection - Data []HaConfigInput `json:"data,omitempty"` - client *HaConfigInputClient -} - -type HaConfigInputClient struct { - rancherClient *RancherClient -} - -type HaConfigInputOperations interface { - List(opts *ListOpts) (*HaConfigInputCollection, error) - Create(opts *HaConfigInput) (*HaConfigInput, error) - Update(existing *HaConfigInput, updates interface{}) (*HaConfigInput, error) - ById(id string) (*HaConfigInput, error) - Delete(container *HaConfigInput) error -} - -func newHaConfigInputClient(rancherClient *RancherClient) *HaConfigInputClient { - return &HaConfigInputClient{ - rancherClient: rancherClient, - } -} - -func (c *HaConfigInputClient) Create(container *HaConfigInput) (*HaConfigInput, error) { - resp := &HaConfigInput{} - err := c.rancherClient.doCreate(HA_CONFIG_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *HaConfigInputClient) Update(existing *HaConfigInput, updates interface{}) (*HaConfigInput, error) { - resp := &HaConfigInput{} - err := c.rancherClient.doUpdate(HA_CONFIG_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HaConfigInputClient) List(opts *ListOpts) (*HaConfigInputCollection, error) { - resp := &HaConfigInputCollection{} - err := c.rancherClient.doList(HA_CONFIG_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HaConfigInputCollection) Next() (*HaConfigInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HaConfigInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HaConfigInputClient) ById(id string) (*HaConfigInput, error) { - resp := &HaConfigInput{} - err := c.rancherClient.doById(HA_CONFIG_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HaConfigInputClient) Delete(container *HaConfigInput) error { - return c.rancherClient.doResourceDelete(HA_CONFIG_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go deleted file mode 100644 index b30b9d8..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go +++ /dev/null @@ -1,131 +0,0 @@ -package client - -const ( - HEALTHCHECK_INSTANCE_HOST_MAP_TYPE = "healthcheckInstanceHostMap" -) - -type HealthcheckInstanceHostMap struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type HealthcheckInstanceHostMapCollection struct { - Collection - Data []HealthcheckInstanceHostMap `json:"data,omitempty"` - client *HealthcheckInstanceHostMapClient -} - -type HealthcheckInstanceHostMapClient struct { - rancherClient *RancherClient -} - -type HealthcheckInstanceHostMapOperations interface { - List(opts *ListOpts) (*HealthcheckInstanceHostMapCollection, error) - Create(opts *HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) - Update(existing *HealthcheckInstanceHostMap, updates interface{}) (*HealthcheckInstanceHostMap, error) - ById(id string) (*HealthcheckInstanceHostMap, error) - Delete(container *HealthcheckInstanceHostMap) error - - ActionCreate(*HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) - - ActionRemove(*HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) -} - -func newHealthcheckInstanceHostMapClient(rancherClient *RancherClient) *HealthcheckInstanceHostMapClient { - return &HealthcheckInstanceHostMapClient{ - rancherClient: rancherClient, - } -} - -func (c *HealthcheckInstanceHostMapClient) Create(container *HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) { - resp := &HealthcheckInstanceHostMap{} - err := c.rancherClient.doCreate(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, container, resp) - return resp, err -} - -func (c *HealthcheckInstanceHostMapClient) Update(existing *HealthcheckInstanceHostMap, updates interface{}) (*HealthcheckInstanceHostMap, error) { - resp := &HealthcheckInstanceHostMap{} - err := c.rancherClient.doUpdate(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HealthcheckInstanceHostMapClient) List(opts *ListOpts) (*HealthcheckInstanceHostMapCollection, error) { - resp := &HealthcheckInstanceHostMapCollection{} - err := c.rancherClient.doList(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HealthcheckInstanceHostMapCollection) Next() (*HealthcheckInstanceHostMapCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HealthcheckInstanceHostMapCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HealthcheckInstanceHostMapClient) ById(id string) (*HealthcheckInstanceHostMap, error) { - resp := &HealthcheckInstanceHostMap{} - err := c.rancherClient.doById(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HealthcheckInstanceHostMapClient) Delete(container *HealthcheckInstanceHostMap) error { - return c.rancherClient.doResourceDelete(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, &container.Resource) -} - -func (c *HealthcheckInstanceHostMapClient) ActionCreate(resource *HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) { - - resp := &HealthcheckInstanceHostMap{} - - err := c.rancherClient.doAction(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HealthcheckInstanceHostMapClient) ActionRemove(resource *HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) { - - resp := &HealthcheckInstanceHostMap{} - - err := c.rancherClient.doAction(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_host.go b/vendor/github.com/rancher/go-rancher/v2/generated_host.go deleted file mode 100644 index 801b330..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_host.go +++ /dev/null @@ -1,275 +0,0 @@ -package client - -const ( - HOST_TYPE = "host" -) - -type Host struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - AgentIpAddress string `json:"agentIpAddress,omitempty" yaml:"agent_ip_address,omitempty"` - - AgentState string `json:"agentState,omitempty" yaml:"agent_state,omitempty"` - - Amazonec2Config *Amazonec2Config `json:"amazonec2Config,omitempty" yaml:"amazonec2config,omitempty"` - - ApiProxy string `json:"apiProxy,omitempty" yaml:"api_proxy,omitempty"` - - AuthCertificateAuthority string `json:"authCertificateAuthority,omitempty" yaml:"auth_certificate_authority,omitempty"` - - AuthKey string `json:"authKey,omitempty" yaml:"auth_key,omitempty"` - - AzureConfig *AzureConfig `json:"azureConfig,omitempty" yaml:"azure_config,omitempty"` - - ComputeTotal int64 `json:"computeTotal,omitempty" yaml:"compute_total,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DigitaloceanConfig *DigitaloceanConfig `json:"digitaloceanConfig,omitempty" yaml:"digitalocean_config,omitempty"` - - DockerVersion string `json:"dockerVersion,omitempty" yaml:"docker_version,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - EngineEnv map[string]interface{} `json:"engineEnv,omitempty" yaml:"engine_env,omitempty"` - - EngineInsecureRegistry []string `json:"engineInsecureRegistry,omitempty" yaml:"engine_insecure_registry,omitempty"` - - EngineInstallUrl string `json:"engineInstallUrl,omitempty" yaml:"engine_install_url,omitempty"` - - EngineLabel map[string]interface{} `json:"engineLabel,omitempty" yaml:"engine_label,omitempty"` - - EngineOpt map[string]interface{} `json:"engineOpt,omitempty" yaml:"engine_opt,omitempty"` - - EngineRegistryMirror []string `json:"engineRegistryMirror,omitempty" yaml:"engine_registry_mirror,omitempty"` - - EngineStorageDriver string `json:"engineStorageDriver,omitempty" yaml:"engine_storage_driver,omitempty"` - - HostTemplateId string `json:"hostTemplateId,omitempty" yaml:"host_template_id,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - Info interface{} `json:"info,omitempty" yaml:"info,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - LocalStorageMb int64 `json:"localStorageMb,omitempty" yaml:"local_storage_mb,omitempty"` - - Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` - - MilliCpu int64 `json:"milliCpu,omitempty" yaml:"milli_cpu,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PacketConfig *PacketConfig `json:"packetConfig,omitempty" yaml:"packet_config,omitempty"` - - PhysicalHostId string `json:"physicalHostId,omitempty" yaml:"physical_host_id,omitempty"` - - PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type HostCollection struct { - Collection - Data []Host `json:"data,omitempty"` - client *HostClient -} - -type HostClient struct { - rancherClient *RancherClient -} - -type HostOperations interface { - List(opts *ListOpts) (*HostCollection, error) - Create(opts *Host) (*Host, error) - Update(existing *Host, updates interface{}) (*Host, error) - ById(id string) (*Host, error) - Delete(container *Host) error - - ActionActivate(*Host) (*Host, error) - - ActionCreate(*Host) (*Host, error) - - ActionDeactivate(*Host) (*Host, error) - - ActionDockersocket(*Host) (*HostAccess, error) - - ActionError(*Host) (*Host, error) - - ActionEvacuate(*Host) (*Host, error) - - ActionProvision(*Host) (*Host, error) - - ActionPurge(*Host) (*Host, error) - - ActionRemove(*Host) (*Host, error) - - ActionUpdate(*Host) (*Host, error) -} - -func newHostClient(rancherClient *RancherClient) *HostClient { - return &HostClient{ - rancherClient: rancherClient, - } -} - -func (c *HostClient) Create(container *Host) (*Host, error) { - resp := &Host{} - err := c.rancherClient.doCreate(HOST_TYPE, container, resp) - return resp, err -} - -func (c *HostClient) Update(existing *Host, updates interface{}) (*Host, error) { - resp := &Host{} - err := c.rancherClient.doUpdate(HOST_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HostClient) List(opts *ListOpts) (*HostCollection, error) { - resp := &HostCollection{} - err := c.rancherClient.doList(HOST_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HostCollection) Next() (*HostCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HostCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HostClient) ById(id string) (*Host, error) { - resp := &Host{} - err := c.rancherClient.doById(HOST_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HostClient) Delete(container *Host) error { - return c.rancherClient.doResourceDelete(HOST_TYPE, &container.Resource) -} - -func (c *HostClient) ActionActivate(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionCreate(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionDeactivate(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionDockersocket(resource *Host) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(HOST_TYPE, "dockersocket", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionError(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionEvacuate(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "evacuate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionProvision(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "provision", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionPurge(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionRemove(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionUpdate(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_host_access.go b/vendor/github.com/rancher/go-rancher/v2/generated_host_access.go deleted file mode 100644 index 7ebc586..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_host_access.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - HOST_ACCESS_TYPE = "hostAccess" -) - -type HostAccess struct { - Resource - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Url string `json:"url,omitempty" yaml:"url,omitempty"` -} - -type HostAccessCollection struct { - Collection - Data []HostAccess `json:"data,omitempty"` - client *HostAccessClient -} - -type HostAccessClient struct { - rancherClient *RancherClient -} - -type HostAccessOperations interface { - List(opts *ListOpts) (*HostAccessCollection, error) - Create(opts *HostAccess) (*HostAccess, error) - Update(existing *HostAccess, updates interface{}) (*HostAccess, error) - ById(id string) (*HostAccess, error) - Delete(container *HostAccess) error -} - -func newHostAccessClient(rancherClient *RancherClient) *HostAccessClient { - return &HostAccessClient{ - rancherClient: rancherClient, - } -} - -func (c *HostAccessClient) Create(container *HostAccess) (*HostAccess, error) { - resp := &HostAccess{} - err := c.rancherClient.doCreate(HOST_ACCESS_TYPE, container, resp) - return resp, err -} - -func (c *HostAccessClient) Update(existing *HostAccess, updates interface{}) (*HostAccess, error) { - resp := &HostAccess{} - err := c.rancherClient.doUpdate(HOST_ACCESS_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HostAccessClient) List(opts *ListOpts) (*HostAccessCollection, error) { - resp := &HostAccessCollection{} - err := c.rancherClient.doList(HOST_ACCESS_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HostAccessCollection) Next() (*HostAccessCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HostAccessCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HostAccessClient) ById(id string) (*HostAccess, error) { - resp := &HostAccess{} - err := c.rancherClient.doById(HOST_ACCESS_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HostAccessClient) Delete(container *HostAccess) error { - return c.rancherClient.doResourceDelete(HOST_ACCESS_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go b/vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go deleted file mode 100644 index 1517b79..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - HOST_API_PROXY_TOKEN_TYPE = "hostApiProxyToken" -) - -type HostApiProxyToken struct { - Resource - - ReportedUuid string `json:"reportedUuid,omitempty" yaml:"reported_uuid,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Url string `json:"url,omitempty" yaml:"url,omitempty"` -} - -type HostApiProxyTokenCollection struct { - Collection - Data []HostApiProxyToken `json:"data,omitempty"` - client *HostApiProxyTokenClient -} - -type HostApiProxyTokenClient struct { - rancherClient *RancherClient -} - -type HostApiProxyTokenOperations interface { - List(opts *ListOpts) (*HostApiProxyTokenCollection, error) - Create(opts *HostApiProxyToken) (*HostApiProxyToken, error) - Update(existing *HostApiProxyToken, updates interface{}) (*HostApiProxyToken, error) - ById(id string) (*HostApiProxyToken, error) - Delete(container *HostApiProxyToken) error -} - -func newHostApiProxyTokenClient(rancherClient *RancherClient) *HostApiProxyTokenClient { - return &HostApiProxyTokenClient{ - rancherClient: rancherClient, - } -} - -func (c *HostApiProxyTokenClient) Create(container *HostApiProxyToken) (*HostApiProxyToken, error) { - resp := &HostApiProxyToken{} - err := c.rancherClient.doCreate(HOST_API_PROXY_TOKEN_TYPE, container, resp) - return resp, err -} - -func (c *HostApiProxyTokenClient) Update(existing *HostApiProxyToken, updates interface{}) (*HostApiProxyToken, error) { - resp := &HostApiProxyToken{} - err := c.rancherClient.doUpdate(HOST_API_PROXY_TOKEN_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HostApiProxyTokenClient) List(opts *ListOpts) (*HostApiProxyTokenCollection, error) { - resp := &HostApiProxyTokenCollection{} - err := c.rancherClient.doList(HOST_API_PROXY_TOKEN_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HostApiProxyTokenCollection) Next() (*HostApiProxyTokenCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HostApiProxyTokenCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HostApiProxyTokenClient) ById(id string) (*HostApiProxyToken, error) { - resp := &HostApiProxyToken{} - err := c.rancherClient.doById(HOST_API_PROXY_TOKEN_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HostApiProxyTokenClient) Delete(container *HostApiProxyToken) error { - return c.rancherClient.doResourceDelete(HOST_API_PROXY_TOKEN_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_host_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_host_template.go deleted file mode 100644 index 42ec654..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_host_template.go +++ /dev/null @@ -1,133 +0,0 @@ -package client - -const ( - HOST_TEMPLATE_TYPE = "hostTemplate" -) - -type HostTemplate struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - FlavorPrefix string `json:"flavorPrefix,omitempty" yaml:"flavor_prefix,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicValues map[string]interface{} `json:"publicValues,omitempty" yaml:"public_values,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SecretValues map[string]interface{} `json:"secretValues,omitempty" yaml:"secret_values,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type HostTemplateCollection struct { - Collection - Data []HostTemplate `json:"data,omitempty"` - client *HostTemplateClient -} - -type HostTemplateClient struct { - rancherClient *RancherClient -} - -type HostTemplateOperations interface { - List(opts *ListOpts) (*HostTemplateCollection, error) - Create(opts *HostTemplate) (*HostTemplate, error) - Update(existing *HostTemplate, updates interface{}) (*HostTemplate, error) - ById(id string) (*HostTemplate, error) - Delete(container *HostTemplate) error - - ActionCreate(*HostTemplate) (*HostTemplate, error) - - ActionRemove(*HostTemplate) (*HostTemplate, error) -} - -func newHostTemplateClient(rancherClient *RancherClient) *HostTemplateClient { - return &HostTemplateClient{ - rancherClient: rancherClient, - } -} - -func (c *HostTemplateClient) Create(container *HostTemplate) (*HostTemplate, error) { - resp := &HostTemplate{} - err := c.rancherClient.doCreate(HOST_TEMPLATE_TYPE, container, resp) - return resp, err -} - -func (c *HostTemplateClient) Update(existing *HostTemplate, updates interface{}) (*HostTemplate, error) { - resp := &HostTemplate{} - err := c.rancherClient.doUpdate(HOST_TEMPLATE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HostTemplateClient) List(opts *ListOpts) (*HostTemplateCollection, error) { - resp := &HostTemplateCollection{} - err := c.rancherClient.doList(HOST_TEMPLATE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HostTemplateCollection) Next() (*HostTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HostTemplateCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HostTemplateClient) ById(id string) (*HostTemplate, error) { - resp := &HostTemplate{} - err := c.rancherClient.doById(HOST_TEMPLATE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HostTemplateClient) Delete(container *HostTemplate) error { - return c.rancherClient.doResourceDelete(HOST_TEMPLATE_TYPE, &container.Resource) -} - -func (c *HostTemplateClient) ActionCreate(resource *HostTemplate) (*HostTemplate, error) { - - resp := &HostTemplate{} - - err := c.rancherClient.doAction(HOST_TEMPLATE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostTemplateClient) ActionRemove(resource *HostTemplate) (*HostTemplate, error) { - - resp := &HostTemplate{} - - err := c.rancherClient.doAction(HOST_TEMPLATE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_identity.go b/vendor/github.com/rancher/go-rancher/v2/generated_identity.go deleted file mode 100644 index 1e5d1d3..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_identity.go +++ /dev/null @@ -1,97 +0,0 @@ -package client - -const ( - IDENTITY_TYPE = "identity" -) - -type Identity struct { - Resource - - All string `json:"all,omitempty" yaml:"all,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExternalIdType string `json:"externalIdType,omitempty" yaml:"external_id_type,omitempty"` - - Login string `json:"login,omitempty" yaml:"login,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - ProfilePicture string `json:"profilePicture,omitempty" yaml:"profile_picture,omitempty"` - - ProfileUrl string `json:"profileUrl,omitempty" yaml:"profile_url,omitempty"` - - ProjectId string `json:"projectId,omitempty" yaml:"project_id,omitempty"` - - Role string `json:"role,omitempty" yaml:"role,omitempty"` - - User bool `json:"user,omitempty" yaml:"user,omitempty"` -} - -type IdentityCollection struct { - Collection - Data []Identity `json:"data,omitempty"` - client *IdentityClient -} - -type IdentityClient struct { - rancherClient *RancherClient -} - -type IdentityOperations interface { - List(opts *ListOpts) (*IdentityCollection, error) - Create(opts *Identity) (*Identity, error) - Update(existing *Identity, updates interface{}) (*Identity, error) - ById(id string) (*Identity, error) - Delete(container *Identity) error -} - -func newIdentityClient(rancherClient *RancherClient) *IdentityClient { - return &IdentityClient{ - rancherClient: rancherClient, - } -} - -func (c *IdentityClient) Create(container *Identity) (*Identity, error) { - resp := &Identity{} - err := c.rancherClient.doCreate(IDENTITY_TYPE, container, resp) - return resp, err -} - -func (c *IdentityClient) Update(existing *Identity, updates interface{}) (*Identity, error) { - resp := &Identity{} - err := c.rancherClient.doUpdate(IDENTITY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *IdentityClient) List(opts *ListOpts) (*IdentityCollection, error) { - resp := &IdentityCollection{} - err := c.rancherClient.doList(IDENTITY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *IdentityCollection) Next() (*IdentityCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &IdentityCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *IdentityClient) ById(id string) (*Identity, error) { - resp := &Identity{} - err := c.rancherClient.doById(IDENTITY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *IdentityClient) Delete(container *Identity) error { - return c.rancherClient.doResourceDelete(IDENTITY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_image.go b/vendor/github.com/rancher/go-rancher/v2/generated_image.go deleted file mode 100644 index 2e0c02d..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_image.go +++ /dev/null @@ -1,169 +0,0 @@ -package client - -const ( - IMAGE_TYPE = "image" -) - -type Image struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ImageCollection struct { - Collection - Data []Image `json:"data,omitempty"` - client *ImageClient -} - -type ImageClient struct { - rancherClient *RancherClient -} - -type ImageOperations interface { - List(opts *ListOpts) (*ImageCollection, error) - Create(opts *Image) (*Image, error) - Update(existing *Image, updates interface{}) (*Image, error) - ById(id string) (*Image, error) - Delete(container *Image) error - - ActionActivate(*Image) (*Image, error) - - ActionCreate(*Image) (*Image, error) - - ActionDeactivate(*Image) (*Image, error) - - ActionPurge(*Image) (*Image, error) - - ActionRemove(*Image) (*Image, error) - - ActionUpdate(*Image) (*Image, error) -} - -func newImageClient(rancherClient *RancherClient) *ImageClient { - return &ImageClient{ - rancherClient: rancherClient, - } -} - -func (c *ImageClient) Create(container *Image) (*Image, error) { - resp := &Image{} - err := c.rancherClient.doCreate(IMAGE_TYPE, container, resp) - return resp, err -} - -func (c *ImageClient) Update(existing *Image, updates interface{}) (*Image, error) { - resp := &Image{} - err := c.rancherClient.doUpdate(IMAGE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ImageClient) List(opts *ListOpts) (*ImageCollection, error) { - resp := &ImageCollection{} - err := c.rancherClient.doList(IMAGE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ImageCollection) Next() (*ImageCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ImageCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ImageClient) ById(id string) (*Image, error) { - resp := &Image{} - err := c.rancherClient.doById(IMAGE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ImageClient) Delete(container *Image) error { - return c.rancherClient.doResourceDelete(IMAGE_TYPE, &container.Resource) -} - -func (c *ImageClient) ActionActivate(resource *Image) (*Image, error) { - - resp := &Image{} - - err := c.rancherClient.doAction(IMAGE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ImageClient) ActionCreate(resource *Image) (*Image, error) { - - resp := &Image{} - - err := c.rancherClient.doAction(IMAGE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ImageClient) ActionDeactivate(resource *Image) (*Image, error) { - - resp := &Image{} - - err := c.rancherClient.doAction(IMAGE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ImageClient) ActionPurge(resource *Image) (*Image, error) { - - resp := &Image{} - - err := c.rancherClient.doAction(IMAGE_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ImageClient) ActionRemove(resource *Image) (*Image, error) { - - resp := &Image{} - - err := c.rancherClient.doAction(IMAGE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ImageClient) ActionUpdate(resource *Image) (*Image, error) { - - resp := &Image{} - - err := c.rancherClient.doAction(IMAGE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go deleted file mode 100644 index 3e93a77..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go +++ /dev/null @@ -1,91 +0,0 @@ -package client - -const ( - IN_SERVICE_UPGRADE_STRATEGY_TYPE = "inServiceUpgradeStrategy" -) - -type InServiceUpgradeStrategy struct { - Resource - - BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"` - - IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - PreviousLaunchConfig *LaunchConfig `json:"previousLaunchConfig,omitempty" yaml:"previous_launch_config,omitempty"` - - PreviousSecondaryLaunchConfigs []SecondaryLaunchConfig `json:"previousSecondaryLaunchConfigs,omitempty" yaml:"previous_secondary_launch_configs,omitempty"` - - SecondaryLaunchConfigs []SecondaryLaunchConfig `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` - - StartFirst bool `json:"startFirst,omitempty" yaml:"start_first,omitempty"` -} - -type InServiceUpgradeStrategyCollection struct { - Collection - Data []InServiceUpgradeStrategy `json:"data,omitempty"` - client *InServiceUpgradeStrategyClient -} - -type InServiceUpgradeStrategyClient struct { - rancherClient *RancherClient -} - -type InServiceUpgradeStrategyOperations interface { - List(opts *ListOpts) (*InServiceUpgradeStrategyCollection, error) - Create(opts *InServiceUpgradeStrategy) (*InServiceUpgradeStrategy, error) - Update(existing *InServiceUpgradeStrategy, updates interface{}) (*InServiceUpgradeStrategy, error) - ById(id string) (*InServiceUpgradeStrategy, error) - Delete(container *InServiceUpgradeStrategy) error -} - -func newInServiceUpgradeStrategyClient(rancherClient *RancherClient) *InServiceUpgradeStrategyClient { - return &InServiceUpgradeStrategyClient{ - rancherClient: rancherClient, - } -} - -func (c *InServiceUpgradeStrategyClient) Create(container *InServiceUpgradeStrategy) (*InServiceUpgradeStrategy, error) { - resp := &InServiceUpgradeStrategy{} - err := c.rancherClient.doCreate(IN_SERVICE_UPGRADE_STRATEGY_TYPE, container, resp) - return resp, err -} - -func (c *InServiceUpgradeStrategyClient) Update(existing *InServiceUpgradeStrategy, updates interface{}) (*InServiceUpgradeStrategy, error) { - resp := &InServiceUpgradeStrategy{} - err := c.rancherClient.doUpdate(IN_SERVICE_UPGRADE_STRATEGY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InServiceUpgradeStrategyClient) List(opts *ListOpts) (*InServiceUpgradeStrategyCollection, error) { - resp := &InServiceUpgradeStrategyCollection{} - err := c.rancherClient.doList(IN_SERVICE_UPGRADE_STRATEGY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InServiceUpgradeStrategyCollection) Next() (*InServiceUpgradeStrategyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InServiceUpgradeStrategyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InServiceUpgradeStrategyClient) ById(id string) (*InServiceUpgradeStrategy, error) { - resp := &InServiceUpgradeStrategy{} - err := c.rancherClient.doById(IN_SERVICE_UPGRADE_STRATEGY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InServiceUpgradeStrategyClient) Delete(container *InServiceUpgradeStrategy) error { - return c.rancherClient.doResourceDelete(IN_SERVICE_UPGRADE_STRATEGY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance.go deleted file mode 100644 index cee9a2e..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_instance.go +++ /dev/null @@ -1,272 +0,0 @@ -package client - -const ( - INSTANCE_TYPE = "instance" -) - -type Instance struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type InstanceCollection struct { - Collection - Data []Instance `json:"data,omitempty"` - client *InstanceClient -} - -type InstanceClient struct { - rancherClient *RancherClient -} - -type InstanceOperations interface { - List(opts *ListOpts) (*InstanceCollection, error) - Create(opts *Instance) (*Instance, error) - Update(existing *Instance, updates interface{}) (*Instance, error) - ById(id string) (*Instance, error) - Delete(container *Instance) error - - ActionAllocate(*Instance) (*Instance, error) - - ActionConsole(*Instance, *InstanceConsoleInput) (*InstanceConsole, error) - - ActionCreate(*Instance) (*Instance, error) - - ActionDeallocate(*Instance) (*Instance, error) - - ActionError(*Instance) (*Instance, error) - - ActionMigrate(*Instance) (*Instance, error) - - ActionPurge(*Instance) (*Instance, error) - - ActionRemove(*Instance) (*Instance, error) - - ActionRestart(*Instance) (*Instance, error) - - ActionStart(*Instance) (*Instance, error) - - ActionStop(*Instance, *InstanceStop) (*Instance, error) - - ActionUpdate(*Instance) (*Instance, error) - - ActionUpdatehealthy(*Instance) (*Instance, error) - - ActionUpdatereinitializing(*Instance) (*Instance, error) - - ActionUpdateunhealthy(*Instance) (*Instance, error) -} - -func newInstanceClient(rancherClient *RancherClient) *InstanceClient { - return &InstanceClient{ - rancherClient: rancherClient, - } -} - -func (c *InstanceClient) Create(container *Instance) (*Instance, error) { - resp := &Instance{} - err := c.rancherClient.doCreate(INSTANCE_TYPE, container, resp) - return resp, err -} - -func (c *InstanceClient) Update(existing *Instance, updates interface{}) (*Instance, error) { - resp := &Instance{} - err := c.rancherClient.doUpdate(INSTANCE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InstanceClient) List(opts *ListOpts) (*InstanceCollection, error) { - resp := &InstanceCollection{} - err := c.rancherClient.doList(INSTANCE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InstanceCollection) Next() (*InstanceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InstanceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InstanceClient) ById(id string) (*Instance, error) { - resp := &Instance{} - err := c.rancherClient.doById(INSTANCE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InstanceClient) Delete(container *Instance) error { - return c.rancherClient.doResourceDelete(INSTANCE_TYPE, &container.Resource) -} - -func (c *InstanceClient) ActionAllocate(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "allocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionConsole(resource *Instance, input *InstanceConsoleInput) (*InstanceConsole, error) { - - resp := &InstanceConsole{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "console", &resource.Resource, input, resp) - - return resp, err -} - -func (c *InstanceClient) ActionCreate(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionDeallocate(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "deallocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionError(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionMigrate(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "migrate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionPurge(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionRemove(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionRestart(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "restart", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionStart(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "start", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionStop(resource *Instance, input *InstanceStop) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "stop", &resource.Resource, input, resp) - - return resp, err -} - -func (c *InstanceClient) ActionUpdate(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionUpdatehealthy(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "updatehealthy", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionUpdatereinitializing(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "updatereinitializing", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionUpdateunhealthy(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "updateunhealthy", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go deleted file mode 100644 index 8574605..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - INSTANCE_CONSOLE_TYPE = "instanceConsole" -) - -type InstanceConsole struct { - Resource - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Password string `json:"password,omitempty" yaml:"password,omitempty"` - - Url string `json:"url,omitempty" yaml:"url,omitempty"` -} - -type InstanceConsoleCollection struct { - Collection - Data []InstanceConsole `json:"data,omitempty"` - client *InstanceConsoleClient -} - -type InstanceConsoleClient struct { - rancherClient *RancherClient -} - -type InstanceConsoleOperations interface { - List(opts *ListOpts) (*InstanceConsoleCollection, error) - Create(opts *InstanceConsole) (*InstanceConsole, error) - Update(existing *InstanceConsole, updates interface{}) (*InstanceConsole, error) - ById(id string) (*InstanceConsole, error) - Delete(container *InstanceConsole) error -} - -func newInstanceConsoleClient(rancherClient *RancherClient) *InstanceConsoleClient { - return &InstanceConsoleClient{ - rancherClient: rancherClient, - } -} - -func (c *InstanceConsoleClient) Create(container *InstanceConsole) (*InstanceConsole, error) { - resp := &InstanceConsole{} - err := c.rancherClient.doCreate(INSTANCE_CONSOLE_TYPE, container, resp) - return resp, err -} - -func (c *InstanceConsoleClient) Update(existing *InstanceConsole, updates interface{}) (*InstanceConsole, error) { - resp := &InstanceConsole{} - err := c.rancherClient.doUpdate(INSTANCE_CONSOLE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InstanceConsoleClient) List(opts *ListOpts) (*InstanceConsoleCollection, error) { - resp := &InstanceConsoleCollection{} - err := c.rancherClient.doList(INSTANCE_CONSOLE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InstanceConsoleCollection) Next() (*InstanceConsoleCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InstanceConsoleCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InstanceConsoleClient) ById(id string) (*InstanceConsole, error) { - resp := &InstanceConsole{} - err := c.rancherClient.doById(INSTANCE_CONSOLE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InstanceConsoleClient) Delete(container *InstanceConsole) error { - return c.rancherClient.doResourceDelete(INSTANCE_CONSOLE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go deleted file mode 100644 index 5bfbe81..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go +++ /dev/null @@ -1,77 +0,0 @@ -package client - -const ( - INSTANCE_CONSOLE_INPUT_TYPE = "instanceConsoleInput" -) - -type InstanceConsoleInput struct { - Resource -} - -type InstanceConsoleInputCollection struct { - Collection - Data []InstanceConsoleInput `json:"data,omitempty"` - client *InstanceConsoleInputClient -} - -type InstanceConsoleInputClient struct { - rancherClient *RancherClient -} - -type InstanceConsoleInputOperations interface { - List(opts *ListOpts) (*InstanceConsoleInputCollection, error) - Create(opts *InstanceConsoleInput) (*InstanceConsoleInput, error) - Update(existing *InstanceConsoleInput, updates interface{}) (*InstanceConsoleInput, error) - ById(id string) (*InstanceConsoleInput, error) - Delete(container *InstanceConsoleInput) error -} - -func newInstanceConsoleInputClient(rancherClient *RancherClient) *InstanceConsoleInputClient { - return &InstanceConsoleInputClient{ - rancherClient: rancherClient, - } -} - -func (c *InstanceConsoleInputClient) Create(container *InstanceConsoleInput) (*InstanceConsoleInput, error) { - resp := &InstanceConsoleInput{} - err := c.rancherClient.doCreate(INSTANCE_CONSOLE_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *InstanceConsoleInputClient) Update(existing *InstanceConsoleInput, updates interface{}) (*InstanceConsoleInput, error) { - resp := &InstanceConsoleInput{} - err := c.rancherClient.doUpdate(INSTANCE_CONSOLE_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InstanceConsoleInputClient) List(opts *ListOpts) (*InstanceConsoleInputCollection, error) { - resp := &InstanceConsoleInputCollection{} - err := c.rancherClient.doList(INSTANCE_CONSOLE_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InstanceConsoleInputCollection) Next() (*InstanceConsoleInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InstanceConsoleInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InstanceConsoleInputClient) ById(id string) (*InstanceConsoleInput, error) { - resp := &InstanceConsoleInput{} - err := c.rancherClient.doById(INSTANCE_CONSOLE_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InstanceConsoleInputClient) Delete(container *InstanceConsoleInput) error { - return c.rancherClient.doResourceDelete(INSTANCE_CONSOLE_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go deleted file mode 100644 index 4f2ce46..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go +++ /dev/null @@ -1,99 +0,0 @@ -package client - -const ( - INSTANCE_HEALTH_CHECK_TYPE = "instanceHealthCheck" -) - -type InstanceHealthCheck struct { - Resource - - HealthyThreshold int64 `json:"healthyThreshold,omitempty" yaml:"healthy_threshold,omitempty"` - - InitializingTimeout int64 `json:"initializingTimeout,omitempty" yaml:"initializing_timeout,omitempty"` - - Interval int64 `json:"interval,omitempty" yaml:"interval,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - - RecreateOnQuorumStrategyConfig *RecreateOnQuorumStrategyConfig `json:"recreateOnQuorumStrategyConfig,omitempty" yaml:"recreate_on_quorum_strategy_config,omitempty"` - - ReinitializingTimeout int64 `json:"reinitializingTimeout,omitempty" yaml:"reinitializing_timeout,omitempty"` - - RequestLine string `json:"requestLine,omitempty" yaml:"request_line,omitempty"` - - ResponseTimeout int64 `json:"responseTimeout,omitempty" yaml:"response_timeout,omitempty"` - - Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"` - - UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty" yaml:"unhealthy_threshold,omitempty"` -} - -type InstanceHealthCheckCollection struct { - Collection - Data []InstanceHealthCheck `json:"data,omitempty"` - client *InstanceHealthCheckClient -} - -type InstanceHealthCheckClient struct { - rancherClient *RancherClient -} - -type InstanceHealthCheckOperations interface { - List(opts *ListOpts) (*InstanceHealthCheckCollection, error) - Create(opts *InstanceHealthCheck) (*InstanceHealthCheck, error) - Update(existing *InstanceHealthCheck, updates interface{}) (*InstanceHealthCheck, error) - ById(id string) (*InstanceHealthCheck, error) - Delete(container *InstanceHealthCheck) error -} - -func newInstanceHealthCheckClient(rancherClient *RancherClient) *InstanceHealthCheckClient { - return &InstanceHealthCheckClient{ - rancherClient: rancherClient, - } -} - -func (c *InstanceHealthCheckClient) Create(container *InstanceHealthCheck) (*InstanceHealthCheck, error) { - resp := &InstanceHealthCheck{} - err := c.rancherClient.doCreate(INSTANCE_HEALTH_CHECK_TYPE, container, resp) - return resp, err -} - -func (c *InstanceHealthCheckClient) Update(existing *InstanceHealthCheck, updates interface{}) (*InstanceHealthCheck, error) { - resp := &InstanceHealthCheck{} - err := c.rancherClient.doUpdate(INSTANCE_HEALTH_CHECK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InstanceHealthCheckClient) List(opts *ListOpts) (*InstanceHealthCheckCollection, error) { - resp := &InstanceHealthCheckCollection{} - err := c.rancherClient.doList(INSTANCE_HEALTH_CHECK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InstanceHealthCheckCollection) Next() (*InstanceHealthCheckCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InstanceHealthCheckCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InstanceHealthCheckClient) ById(id string) (*InstanceHealthCheck, error) { - resp := &InstanceHealthCheck{} - err := c.rancherClient.doById(INSTANCE_HEALTH_CHECK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InstanceHealthCheckClient) Delete(container *InstanceHealthCheck) error { - return c.rancherClient.doResourceDelete(INSTANCE_HEALTH_CHECK_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go deleted file mode 100644 index 4aa86e3..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go +++ /dev/null @@ -1,177 +0,0 @@ -package client - -const ( - INSTANCE_LINK_TYPE = "instanceLink" -) - -type InstanceLink struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LinkName string `json:"linkName,omitempty" yaml:"link_name,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Ports []interface{} `json:"ports,omitempty" yaml:"ports,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - TargetInstanceId string `json:"targetInstanceId,omitempty" yaml:"target_instance_id,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type InstanceLinkCollection struct { - Collection - Data []InstanceLink `json:"data,omitempty"` - client *InstanceLinkClient -} - -type InstanceLinkClient struct { - rancherClient *RancherClient -} - -type InstanceLinkOperations interface { - List(opts *ListOpts) (*InstanceLinkCollection, error) - Create(opts *InstanceLink) (*InstanceLink, error) - Update(existing *InstanceLink, updates interface{}) (*InstanceLink, error) - ById(id string) (*InstanceLink, error) - Delete(container *InstanceLink) error - - ActionActivate(*InstanceLink) (*InstanceLink, error) - - ActionCreate(*InstanceLink) (*InstanceLink, error) - - ActionDeactivate(*InstanceLink) (*InstanceLink, error) - - ActionPurge(*InstanceLink) (*InstanceLink, error) - - ActionRemove(*InstanceLink) (*InstanceLink, error) - - ActionUpdate(*InstanceLink) (*InstanceLink, error) -} - -func newInstanceLinkClient(rancherClient *RancherClient) *InstanceLinkClient { - return &InstanceLinkClient{ - rancherClient: rancherClient, - } -} - -func (c *InstanceLinkClient) Create(container *InstanceLink) (*InstanceLink, error) { - resp := &InstanceLink{} - err := c.rancherClient.doCreate(INSTANCE_LINK_TYPE, container, resp) - return resp, err -} - -func (c *InstanceLinkClient) Update(existing *InstanceLink, updates interface{}) (*InstanceLink, error) { - resp := &InstanceLink{} - err := c.rancherClient.doUpdate(INSTANCE_LINK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InstanceLinkClient) List(opts *ListOpts) (*InstanceLinkCollection, error) { - resp := &InstanceLinkCollection{} - err := c.rancherClient.doList(INSTANCE_LINK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InstanceLinkCollection) Next() (*InstanceLinkCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InstanceLinkCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InstanceLinkClient) ById(id string) (*InstanceLink, error) { - resp := &InstanceLink{} - err := c.rancherClient.doById(INSTANCE_LINK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InstanceLinkClient) Delete(container *InstanceLink) error { - return c.rancherClient.doResourceDelete(INSTANCE_LINK_TYPE, &container.Resource) -} - -func (c *InstanceLinkClient) ActionActivate(resource *InstanceLink) (*InstanceLink, error) { - - resp := &InstanceLink{} - - err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceLinkClient) ActionCreate(resource *InstanceLink) (*InstanceLink, error) { - - resp := &InstanceLink{} - - err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceLinkClient) ActionDeactivate(resource *InstanceLink) (*InstanceLink, error) { - - resp := &InstanceLink{} - - err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceLinkClient) ActionPurge(resource *InstanceLink) (*InstanceLink, error) { - - resp := &InstanceLink{} - - err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceLinkClient) ActionRemove(resource *InstanceLink) (*InstanceLink, error) { - - resp := &InstanceLink{} - - err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceLinkClient) ActionUpdate(resource *InstanceLink) (*InstanceLink, error) { - - resp := &InstanceLink{} - - err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go deleted file mode 100644 index 2e3b2b6..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - INSTANCE_STOP_TYPE = "instanceStop" -) - -type InstanceStop struct { - Resource - - Remove bool `json:"remove,omitempty" yaml:"remove,omitempty"` - - Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` -} - -type InstanceStopCollection struct { - Collection - Data []InstanceStop `json:"data,omitempty"` - client *InstanceStopClient -} - -type InstanceStopClient struct { - rancherClient *RancherClient -} - -type InstanceStopOperations interface { - List(opts *ListOpts) (*InstanceStopCollection, error) - Create(opts *InstanceStop) (*InstanceStop, error) - Update(existing *InstanceStop, updates interface{}) (*InstanceStop, error) - ById(id string) (*InstanceStop, error) - Delete(container *InstanceStop) error -} - -func newInstanceStopClient(rancherClient *RancherClient) *InstanceStopClient { - return &InstanceStopClient{ - rancherClient: rancherClient, - } -} - -func (c *InstanceStopClient) Create(container *InstanceStop) (*InstanceStop, error) { - resp := &InstanceStop{} - err := c.rancherClient.doCreate(INSTANCE_STOP_TYPE, container, resp) - return resp, err -} - -func (c *InstanceStopClient) Update(existing *InstanceStop, updates interface{}) (*InstanceStop, error) { - resp := &InstanceStop{} - err := c.rancherClient.doUpdate(INSTANCE_STOP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InstanceStopClient) List(opts *ListOpts) (*InstanceStopCollection, error) { - resp := &InstanceStopCollection{} - err := c.rancherClient.doList(INSTANCE_STOP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InstanceStopCollection) Next() (*InstanceStopCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InstanceStopCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InstanceStopClient) ById(id string) (*InstanceStop, error) { - resp := &InstanceStop{} - err := c.rancherClient.doById(INSTANCE_STOP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InstanceStopClient) Delete(container *InstanceStop) error { - return c.rancherClient.doResourceDelete(INSTANCE_STOP_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go b/vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go deleted file mode 100644 index a41d2c7..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go +++ /dev/null @@ -1,195 +0,0 @@ -package client - -const ( - IP_ADDRESS_TYPE = "ipAddress" -) - -type IpAddress struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Address string `json:"address,omitempty" yaml:"address,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NetworkId string `json:"networkId,omitempty" yaml:"network_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type IpAddressCollection struct { - Collection - Data []IpAddress `json:"data,omitempty"` - client *IpAddressClient -} - -type IpAddressClient struct { - rancherClient *RancherClient -} - -type IpAddressOperations interface { - List(opts *ListOpts) (*IpAddressCollection, error) - Create(opts *IpAddress) (*IpAddress, error) - Update(existing *IpAddress, updates interface{}) (*IpAddress, error) - ById(id string) (*IpAddress, error) - Delete(container *IpAddress) error - - ActionActivate(*IpAddress) (*IpAddress, error) - - ActionAssociate(*IpAddress) (*IpAddress, error) - - ActionCreate(*IpAddress) (*IpAddress, error) - - ActionDeactivate(*IpAddress) (*IpAddress, error) - - ActionDisassociate(*IpAddress) (*IpAddress, error) - - ActionPurge(*IpAddress) (*IpAddress, error) - - ActionRemove(*IpAddress) (*IpAddress, error) - - ActionUpdate(*IpAddress) (*IpAddress, error) -} - -func newIpAddressClient(rancherClient *RancherClient) *IpAddressClient { - return &IpAddressClient{ - rancherClient: rancherClient, - } -} - -func (c *IpAddressClient) Create(container *IpAddress) (*IpAddress, error) { - resp := &IpAddress{} - err := c.rancherClient.doCreate(IP_ADDRESS_TYPE, container, resp) - return resp, err -} - -func (c *IpAddressClient) Update(existing *IpAddress, updates interface{}) (*IpAddress, error) { - resp := &IpAddress{} - err := c.rancherClient.doUpdate(IP_ADDRESS_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *IpAddressClient) List(opts *ListOpts) (*IpAddressCollection, error) { - resp := &IpAddressCollection{} - err := c.rancherClient.doList(IP_ADDRESS_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *IpAddressCollection) Next() (*IpAddressCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &IpAddressCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *IpAddressClient) ById(id string) (*IpAddress, error) { - resp := &IpAddress{} - err := c.rancherClient.doById(IP_ADDRESS_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *IpAddressClient) Delete(container *IpAddress) error { - return c.rancherClient.doResourceDelete(IP_ADDRESS_TYPE, &container.Resource) -} - -func (c *IpAddressClient) ActionActivate(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionAssociate(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "associate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionCreate(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionDeactivate(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionDisassociate(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "disassociate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionPurge(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionRemove(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionUpdate(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go deleted file mode 100644 index 15fa378..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go +++ /dev/null @@ -1,275 +0,0 @@ -package client - -const ( - KUBERNETES_SERVICE_TYPE = "kubernetesService" -) - -type KubernetesService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Template interface{} `json:"template,omitempty" yaml:"template,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` -} - -type KubernetesServiceCollection struct { - Collection - Data []KubernetesService `json:"data,omitempty"` - client *KubernetesServiceClient -} - -type KubernetesServiceClient struct { - rancherClient *RancherClient -} - -type KubernetesServiceOperations interface { - List(opts *ListOpts) (*KubernetesServiceCollection, error) - Create(opts *KubernetesService) (*KubernetesService, error) - Update(existing *KubernetesService, updates interface{}) (*KubernetesService, error) - ById(id string) (*KubernetesService, error) - Delete(container *KubernetesService) error - - ActionActivate(*KubernetesService) (*Service, error) - - ActionAddservicelink(*KubernetesService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionCancelupgrade(*KubernetesService) (*Service, error) - - ActionContinueupgrade(*KubernetesService) (*Service, error) - - ActionCreate(*KubernetesService) (*Service, error) - - ActionDeactivate(*KubernetesService) (*Service, error) - - ActionFinishupgrade(*KubernetesService) (*Service, error) - - ActionRemove(*KubernetesService) (*Service, error) - - ActionRemoveservicelink(*KubernetesService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionRestart(*KubernetesService, *ServiceRestart) (*Service, error) - - ActionRollback(*KubernetesService) (*Service, error) - - ActionSetservicelinks(*KubernetesService, *SetServiceLinksInput) (*Service, error) - - ActionUpdate(*KubernetesService) (*Service, error) - - ActionUpgrade(*KubernetesService, *ServiceUpgrade) (*Service, error) -} - -func newKubernetesServiceClient(rancherClient *RancherClient) *KubernetesServiceClient { - return &KubernetesServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *KubernetesServiceClient) Create(container *KubernetesService) (*KubernetesService, error) { - resp := &KubernetesService{} - err := c.rancherClient.doCreate(KUBERNETES_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *KubernetesServiceClient) Update(existing *KubernetesService, updates interface{}) (*KubernetesService, error) { - resp := &KubernetesService{} - err := c.rancherClient.doUpdate(KUBERNETES_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *KubernetesServiceClient) List(opts *ListOpts) (*KubernetesServiceCollection, error) { - resp := &KubernetesServiceCollection{} - err := c.rancherClient.doList(KUBERNETES_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *KubernetesServiceCollection) Next() (*KubernetesServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &KubernetesServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *KubernetesServiceClient) ById(id string) (*KubernetesService, error) { - resp := &KubernetesService{} - err := c.rancherClient.doById(KUBERNETES_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *KubernetesServiceClient) Delete(container *KubernetesService) error { - return c.rancherClient.doResourceDelete(KUBERNETES_SERVICE_TYPE, &container.Resource) -} - -func (c *KubernetesServiceClient) ActionActivate(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionAddservicelink(resource *KubernetesService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionCancelupgrade(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionContinueupgrade(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionCreate(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionDeactivate(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionFinishupgrade(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionRemove(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionRemoveservicelink(resource *KubernetesService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionRestart(resource *KubernetesService, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionRollback(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionSetservicelinks(resource *KubernetesService, input *SetServiceLinksInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionUpdate(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionUpgrade(resource *KubernetesService, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go deleted file mode 100644 index ef8eaa3..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go +++ /dev/null @@ -1,204 +0,0 @@ -package client - -const ( - KUBERNETES_STACK_TYPE = "kubernetesStack" -) - -type KubernetesStack struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` - - Binding *Binding `json:"binding,omitempty" yaml:"binding,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Group string `json:"group,omitempty" yaml:"group,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` - - PreviousEnvironment map[string]interface{} `json:"previousEnvironment,omitempty" yaml:"previous_environment,omitempty"` - - PreviousExternalId string `json:"previousExternalId,omitempty" yaml:"previous_external_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type KubernetesStackCollection struct { - Collection - Data []KubernetesStack `json:"data,omitempty"` - client *KubernetesStackClient -} - -type KubernetesStackClient struct { - rancherClient *RancherClient -} - -type KubernetesStackOperations interface { - List(opts *ListOpts) (*KubernetesStackCollection, error) - Create(opts *KubernetesStack) (*KubernetesStack, error) - Update(existing *KubernetesStack, updates interface{}) (*KubernetesStack, error) - ById(id string) (*KubernetesStack, error) - Delete(container *KubernetesStack) error - - ActionCancelupgrade(*KubernetesStack) (*Stack, error) - - ActionCreate(*KubernetesStack) (*Stack, error) - - ActionError(*KubernetesStack) (*Stack, error) - - ActionFinishupgrade(*KubernetesStack) (*Stack, error) - - ActionRemove(*KubernetesStack) (*Stack, error) - - ActionRollback(*KubernetesStack) (*Stack, error) - - ActionUpgrade(*KubernetesStack, *KubernetesStackUpgrade) (*KubernetesStack, error) -} - -func newKubernetesStackClient(rancherClient *RancherClient) *KubernetesStackClient { - return &KubernetesStackClient{ - rancherClient: rancherClient, - } -} - -func (c *KubernetesStackClient) Create(container *KubernetesStack) (*KubernetesStack, error) { - resp := &KubernetesStack{} - err := c.rancherClient.doCreate(KUBERNETES_STACK_TYPE, container, resp) - return resp, err -} - -func (c *KubernetesStackClient) Update(existing *KubernetesStack, updates interface{}) (*KubernetesStack, error) { - resp := &KubernetesStack{} - err := c.rancherClient.doUpdate(KUBERNETES_STACK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *KubernetesStackClient) List(opts *ListOpts) (*KubernetesStackCollection, error) { - resp := &KubernetesStackCollection{} - err := c.rancherClient.doList(KUBERNETES_STACK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *KubernetesStackCollection) Next() (*KubernetesStackCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &KubernetesStackCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *KubernetesStackClient) ById(id string) (*KubernetesStack, error) { - resp := &KubernetesStack{} - err := c.rancherClient.doById(KUBERNETES_STACK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *KubernetesStackClient) Delete(container *KubernetesStack) error { - return c.rancherClient.doResourceDelete(KUBERNETES_STACK_TYPE, &container.Resource) -} - -func (c *KubernetesStackClient) ActionCancelupgrade(resource *KubernetesStack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesStackClient) ActionCreate(resource *KubernetesStack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesStackClient) ActionError(resource *KubernetesStack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesStackClient) ActionFinishupgrade(resource *KubernetesStack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesStackClient) ActionRemove(resource *KubernetesStack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesStackClient) ActionRollback(resource *KubernetesStack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesStackClient) ActionUpgrade(resource *KubernetesStack, input *KubernetesStackUpgrade) (*KubernetesStack, error) { - - resp := &KubernetesStack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go deleted file mode 100644 index 793b10e..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -const ( - KUBERNETES_STACK_UPGRADE_TYPE = "kubernetesStackUpgrade" -) - -type KubernetesStackUpgrade struct { - Resource - - Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` -} - -type KubernetesStackUpgradeCollection struct { - Collection - Data []KubernetesStackUpgrade `json:"data,omitempty"` - client *KubernetesStackUpgradeClient -} - -type KubernetesStackUpgradeClient struct { - rancherClient *RancherClient -} - -type KubernetesStackUpgradeOperations interface { - List(opts *ListOpts) (*KubernetesStackUpgradeCollection, error) - Create(opts *KubernetesStackUpgrade) (*KubernetesStackUpgrade, error) - Update(existing *KubernetesStackUpgrade, updates interface{}) (*KubernetesStackUpgrade, error) - ById(id string) (*KubernetesStackUpgrade, error) - Delete(container *KubernetesStackUpgrade) error -} - -func newKubernetesStackUpgradeClient(rancherClient *RancherClient) *KubernetesStackUpgradeClient { - return &KubernetesStackUpgradeClient{ - rancherClient: rancherClient, - } -} - -func (c *KubernetesStackUpgradeClient) Create(container *KubernetesStackUpgrade) (*KubernetesStackUpgrade, error) { - resp := &KubernetesStackUpgrade{} - err := c.rancherClient.doCreate(KUBERNETES_STACK_UPGRADE_TYPE, container, resp) - return resp, err -} - -func (c *KubernetesStackUpgradeClient) Update(existing *KubernetesStackUpgrade, updates interface{}) (*KubernetesStackUpgrade, error) { - resp := &KubernetesStackUpgrade{} - err := c.rancherClient.doUpdate(KUBERNETES_STACK_UPGRADE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *KubernetesStackUpgradeClient) List(opts *ListOpts) (*KubernetesStackUpgradeCollection, error) { - resp := &KubernetesStackUpgradeCollection{} - err := c.rancherClient.doList(KUBERNETES_STACK_UPGRADE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *KubernetesStackUpgradeCollection) Next() (*KubernetesStackUpgradeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &KubernetesStackUpgradeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *KubernetesStackUpgradeClient) ById(id string) (*KubernetesStackUpgrade, error) { - resp := &KubernetesStackUpgrade{} - err := c.rancherClient.doById(KUBERNETES_STACK_UPGRADE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *KubernetesStackUpgradeClient) Delete(container *KubernetesStackUpgrade) error { - return c.rancherClient.doResourceDelete(KUBERNETES_STACK_UPGRADE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_label.go b/vendor/github.com/rancher/go-rancher/v2/generated_label.go deleted file mode 100644 index 6b67a2e..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_label.go +++ /dev/null @@ -1,129 +0,0 @@ -package client - -const ( - LABEL_TYPE = "label" -) - -type Label struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Key string `json:"key,omitempty" yaml:"key,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} - -type LabelCollection struct { - Collection - Data []Label `json:"data,omitempty"` - client *LabelClient -} - -type LabelClient struct { - rancherClient *RancherClient -} - -type LabelOperations interface { - List(opts *ListOpts) (*LabelCollection, error) - Create(opts *Label) (*Label, error) - Update(existing *Label, updates interface{}) (*Label, error) - ById(id string) (*Label, error) - Delete(container *Label) error - - ActionCreate(*Label) (*Label, error) - - ActionRemove(*Label) (*Label, error) -} - -func newLabelClient(rancherClient *RancherClient) *LabelClient { - return &LabelClient{ - rancherClient: rancherClient, - } -} - -func (c *LabelClient) Create(container *Label) (*Label, error) { - resp := &Label{} - err := c.rancherClient.doCreate(LABEL_TYPE, container, resp) - return resp, err -} - -func (c *LabelClient) Update(existing *Label, updates interface{}) (*Label, error) { - resp := &Label{} - err := c.rancherClient.doUpdate(LABEL_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LabelClient) List(opts *ListOpts) (*LabelCollection, error) { - resp := &LabelCollection{} - err := c.rancherClient.doList(LABEL_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LabelCollection) Next() (*LabelCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LabelCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LabelClient) ById(id string) (*Label, error) { - resp := &Label{} - err := c.rancherClient.doById(LABEL_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LabelClient) Delete(container *Label) error { - return c.rancherClient.doResourceDelete(LABEL_TYPE, &container.Resource) -} - -func (c *LabelClient) ActionCreate(resource *Label) (*Label, error) { - - resp := &Label{} - - err := c.rancherClient.doAction(LABEL_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LabelClient) ActionRemove(resource *Label) (*Label, error) { - - resp := &Label{} - - err := c.rancherClient.doAction(LABEL_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go deleted file mode 100644 index adbb6b1..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go +++ /dev/null @@ -1,518 +0,0 @@ -package client - -const ( - LAUNCH_CONFIG_TYPE = "launchConfig" -) - -type LaunchConfig struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - AllocationState string `json:"allocationState,omitempty" yaml:"allocation_state,omitempty"` - - BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` - - BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,omitempty"` - - Build *DockerBuild `json:"build,omitempty" yaml:"build,omitempty"` - - CapAdd []string `json:"capAdd,omitempty" yaml:"cap_add,omitempty"` - - CapDrop []string `json:"capDrop,omitempty" yaml:"cap_drop,omitempty"` - - CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` - - Command []string `json:"command,omitempty" yaml:"command,omitempty"` - - Count int64 `json:"count,omitempty" yaml:"count,omitempty"` - - CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` - - CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` - - CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` - - CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` - - CpuRealtimePeriod int64 `json:"cpuRealtimePeriod,omitempty" yaml:"cpu_realtime_period,omitempty"` - - CpuRealtimeRuntime int64 `json:"cpuRealtimeRuntime,omitempty" yaml:"cpu_realtime_runtime,omitempty"` - - CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` - - CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` - - CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DataVolumeMounts map[string]interface{} `json:"dataVolumeMounts,omitempty" yaml:"data_volume_mounts,omitempty"` - - DataVolumes []string `json:"dataVolumes,omitempty" yaml:"data_volumes,omitempty"` - - DataVolumesFrom []string `json:"dataVolumesFrom,omitempty" yaml:"data_volumes_from,omitempty"` - - DataVolumesFromLaunchConfigs []string `json:"dataVolumesFromLaunchConfigs,omitempty" yaml:"data_volumes_from_launch_configs,omitempty"` - - DeploymentUnitUuid string `json:"deploymentUnitUuid,omitempty" yaml:"deployment_unit_uuid,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` - - DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` - - Disks []VirtualMachineDisk `json:"disks,omitempty" yaml:"disks,omitempty"` - - Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` - - DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` - - DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` - - DrainTimeoutMs int64 `json:"drainTimeoutMs,omitempty" yaml:"drain_timeout_ms,omitempty"` - - EntryPoint []string `json:"entryPoint,omitempty" yaml:"entry_point,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - Expose []string `json:"expose,omitempty" yaml:"expose,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExtraHosts []string `json:"extraHosts,omitempty" yaml:"extra_hosts,omitempty"` - - FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` - - GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` - - HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` - - HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` - - HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` - - HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - ImageUuid string `json:"imageUuid,omitempty" yaml:"image_uuid,omitempty"` - - InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` - - InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` - - IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` - - IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` - - Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` - - Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` - - IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` - - Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` - - KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - LogConfig *LogConfig `json:"logConfig,omitempty" yaml:"log_config,omitempty"` - - LxcConf map[string]interface{} `json:"lxcConf,omitempty" yaml:"lxc_conf,omitempty"` - - Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` - - MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` - - MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` - - MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` - - MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` - - MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` - - Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` - - NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` - - NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` - - NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` - - NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` - - NetworkLaunchConfig string `json:"networkLaunchConfig,omitempty" yaml:"network_launch_config,omitempty"` - - NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` - - OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` - - OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` - - PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` - - PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` - - PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` - - Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` - - PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` - - ReadOnly bool `json:"readOnly,omitempty" yaml:"read_only,omitempty"` - - RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RequestedHostId string `json:"requestedHostId,omitempty" yaml:"requested_host_id,omitempty"` - - RequestedIpAddress string `json:"requestedIpAddress,omitempty" yaml:"requested_ip_address,omitempty"` - - RunInit bool `json:"runInit,omitempty" yaml:"run_init,omitempty"` - - Secrets []SecretReference `json:"secrets,omitempty" yaml:"secrets,omitempty"` - - SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` - - StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` - - StopTimeout int64 `json:"stopTimeout,omitempty" yaml:"stop_timeout,omitempty"` - - StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` - - Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` - - Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` - - User string `json:"user,omitempty" yaml:"user,omitempty"` - - UserPorts []string `json:"userPorts,omitempty" yaml:"user_ports,omitempty"` - - Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` - - UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` - - Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` - - VolumeDriver string `json:"volumeDriver,omitempty" yaml:"volume_driver,omitempty"` - - WorkingDir string `json:"workingDir,omitempty" yaml:"working_dir,omitempty"` -} - -type LaunchConfigCollection struct { - Collection - Data []LaunchConfig `json:"data,omitempty"` - client *LaunchConfigClient -} - -type LaunchConfigClient struct { - rancherClient *RancherClient -} - -type LaunchConfigOperations interface { - List(opts *ListOpts) (*LaunchConfigCollection, error) - Create(opts *LaunchConfig) (*LaunchConfig, error) - Update(existing *LaunchConfig, updates interface{}) (*LaunchConfig, error) - ById(id string) (*LaunchConfig, error) - Delete(container *LaunchConfig) error - - ActionAllocate(*LaunchConfig) (*Instance, error) - - ActionConsole(*LaunchConfig, *InstanceConsoleInput) (*InstanceConsole, error) - - ActionCreate(*LaunchConfig) (*Instance, error) - - ActionDeallocate(*LaunchConfig) (*Instance, error) - - ActionError(*LaunchConfig) (*Instance, error) - - ActionExecute(*LaunchConfig, *ContainerExec) (*HostAccess, error) - - ActionMigrate(*LaunchConfig) (*Instance, error) - - ActionProxy(*LaunchConfig, *ContainerProxy) (*HostAccess, error) - - ActionPurge(*LaunchConfig) (*Instance, error) - - ActionRemove(*LaunchConfig) (*Instance, error) - - ActionRestart(*LaunchConfig) (*Instance, error) - - ActionStart(*LaunchConfig) (*Instance, error) - - ActionStop(*LaunchConfig, *InstanceStop) (*Instance, error) - - ActionUpdate(*LaunchConfig) (*Instance, error) - - ActionUpdatehealthy(*LaunchConfig) (*Instance, error) - - ActionUpdatereinitializing(*LaunchConfig) (*Instance, error) - - ActionUpdateunhealthy(*LaunchConfig) (*Instance, error) -} - -func newLaunchConfigClient(rancherClient *RancherClient) *LaunchConfigClient { - return &LaunchConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *LaunchConfigClient) Create(container *LaunchConfig) (*LaunchConfig, error) { - resp := &LaunchConfig{} - err := c.rancherClient.doCreate(LAUNCH_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *LaunchConfigClient) Update(existing *LaunchConfig, updates interface{}) (*LaunchConfig, error) { - resp := &LaunchConfig{} - err := c.rancherClient.doUpdate(LAUNCH_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LaunchConfigClient) List(opts *ListOpts) (*LaunchConfigCollection, error) { - resp := &LaunchConfigCollection{} - err := c.rancherClient.doList(LAUNCH_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LaunchConfigCollection) Next() (*LaunchConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LaunchConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LaunchConfigClient) ById(id string) (*LaunchConfig, error) { - resp := &LaunchConfig{} - err := c.rancherClient.doById(LAUNCH_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LaunchConfigClient) Delete(container *LaunchConfig) error { - return c.rancherClient.doResourceDelete(LAUNCH_CONFIG_TYPE, &container.Resource) -} - -func (c *LaunchConfigClient) ActionAllocate(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "allocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionConsole(resource *LaunchConfig, input *InstanceConsoleInput) (*InstanceConsole, error) { - - resp := &InstanceConsole{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "console", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionCreate(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionDeallocate(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "deallocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionError(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionExecute(resource *LaunchConfig, input *ContainerExec) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "execute", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionMigrate(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "migrate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionProxy(resource *LaunchConfig, input *ContainerProxy) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "proxy", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionPurge(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionRemove(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionRestart(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "restart", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionStart(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "start", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionStop(resource *LaunchConfig, input *InstanceStop) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "stop", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionUpdate(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionUpdatehealthy(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "updatehealthy", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionUpdatereinitializing(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "updatereinitializing", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionUpdateunhealthy(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "updateunhealthy", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go deleted file mode 100644 index 80edbdf..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - LB_CONFIG_TYPE = "lbConfig" -) - -type LbConfig struct { - Resource - - CertificateIds []string `json:"certificateIds,omitempty" yaml:"certificate_ids,omitempty"` - - Config string `json:"config,omitempty" yaml:"config,omitempty"` - - DefaultCertificateId string `json:"defaultCertificateId,omitempty" yaml:"default_certificate_id,omitempty"` - - PortRules []PortRule `json:"portRules,omitempty" yaml:"port_rules,omitempty"` - - StickinessPolicy *LoadBalancerCookieStickinessPolicy `json:"stickinessPolicy,omitempty" yaml:"stickiness_policy,omitempty"` -} - -type LbConfigCollection struct { - Collection - Data []LbConfig `json:"data,omitempty"` - client *LbConfigClient -} - -type LbConfigClient struct { - rancherClient *RancherClient -} - -type LbConfigOperations interface { - List(opts *ListOpts) (*LbConfigCollection, error) - Create(opts *LbConfig) (*LbConfig, error) - Update(existing *LbConfig, updates interface{}) (*LbConfig, error) - ById(id string) (*LbConfig, error) - Delete(container *LbConfig) error -} - -func newLbConfigClient(rancherClient *RancherClient) *LbConfigClient { - return &LbConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *LbConfigClient) Create(container *LbConfig) (*LbConfig, error) { - resp := &LbConfig{} - err := c.rancherClient.doCreate(LB_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *LbConfigClient) Update(existing *LbConfig, updates interface{}) (*LbConfig, error) { - resp := &LbConfig{} - err := c.rancherClient.doUpdate(LB_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LbConfigClient) List(opts *ListOpts) (*LbConfigCollection, error) { - resp := &LbConfigCollection{} - err := c.rancherClient.doList(LB_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LbConfigCollection) Next() (*LbConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LbConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LbConfigClient) ById(id string) (*LbConfig, error) { - resp := &LbConfig{} - err := c.rancherClient.doById(LB_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LbConfigClient) Delete(container *LbConfig) error { - return c.rancherClient.doResourceDelete(LB_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go deleted file mode 100644 index 93088a6..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - LB_TARGET_CONFIG_TYPE = "lbTargetConfig" -) - -type LbTargetConfig struct { - Resource - - PortRules []TargetPortRule `json:"portRules,omitempty" yaml:"port_rules,omitempty"` -} - -type LbTargetConfigCollection struct { - Collection - Data []LbTargetConfig `json:"data,omitempty"` - client *LbTargetConfigClient -} - -type LbTargetConfigClient struct { - rancherClient *RancherClient -} - -type LbTargetConfigOperations interface { - List(opts *ListOpts) (*LbTargetConfigCollection, error) - Create(opts *LbTargetConfig) (*LbTargetConfig, error) - Update(existing *LbTargetConfig, updates interface{}) (*LbTargetConfig, error) - ById(id string) (*LbTargetConfig, error) - Delete(container *LbTargetConfig) error -} - -func newLbTargetConfigClient(rancherClient *RancherClient) *LbTargetConfigClient { - return &LbTargetConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *LbTargetConfigClient) Create(container *LbTargetConfig) (*LbTargetConfig, error) { - resp := &LbTargetConfig{} - err := c.rancherClient.doCreate(LB_TARGET_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *LbTargetConfigClient) Update(existing *LbTargetConfig, updates interface{}) (*LbTargetConfig, error) { - resp := &LbTargetConfig{} - err := c.rancherClient.doUpdate(LB_TARGET_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LbTargetConfigClient) List(opts *ListOpts) (*LbTargetConfigCollection, error) { - resp := &LbTargetConfigCollection{} - err := c.rancherClient.doList(LB_TARGET_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LbTargetConfigCollection) Next() (*LbTargetConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LbTargetConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LbTargetConfigClient) ById(id string) (*LbTargetConfig, error) { - resp := &LbTargetConfig{} - err := c.rancherClient.doById(LB_TARGET_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LbTargetConfigClient) Delete(container *LbTargetConfig) error { - return c.rancherClient.doResourceDelete(LB_TARGET_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go deleted file mode 100644 index 4a8d698..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go +++ /dev/null @@ -1,91 +0,0 @@ -package client - -const ( - LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE = "loadBalancerCookieStickinessPolicy" -) - -type LoadBalancerCookieStickinessPolicy struct { - Resource - - Cookie string `json:"cookie,omitempty" yaml:"cookie,omitempty"` - - Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` - - Indirect bool `json:"indirect,omitempty" yaml:"indirect,omitempty"` - - Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Nocache bool `json:"nocache,omitempty" yaml:"nocache,omitempty"` - - Postonly bool `json:"postonly,omitempty" yaml:"postonly,omitempty"` -} - -type LoadBalancerCookieStickinessPolicyCollection struct { - Collection - Data []LoadBalancerCookieStickinessPolicy `json:"data,omitempty"` - client *LoadBalancerCookieStickinessPolicyClient -} - -type LoadBalancerCookieStickinessPolicyClient struct { - rancherClient *RancherClient -} - -type LoadBalancerCookieStickinessPolicyOperations interface { - List(opts *ListOpts) (*LoadBalancerCookieStickinessPolicyCollection, error) - Create(opts *LoadBalancerCookieStickinessPolicy) (*LoadBalancerCookieStickinessPolicy, error) - Update(existing *LoadBalancerCookieStickinessPolicy, updates interface{}) (*LoadBalancerCookieStickinessPolicy, error) - ById(id string) (*LoadBalancerCookieStickinessPolicy, error) - Delete(container *LoadBalancerCookieStickinessPolicy) error -} - -func newLoadBalancerCookieStickinessPolicyClient(rancherClient *RancherClient) *LoadBalancerCookieStickinessPolicyClient { - return &LoadBalancerCookieStickinessPolicyClient{ - rancherClient: rancherClient, - } -} - -func (c *LoadBalancerCookieStickinessPolicyClient) Create(container *LoadBalancerCookieStickinessPolicy) (*LoadBalancerCookieStickinessPolicy, error) { - resp := &LoadBalancerCookieStickinessPolicy{} - err := c.rancherClient.doCreate(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, container, resp) - return resp, err -} - -func (c *LoadBalancerCookieStickinessPolicyClient) Update(existing *LoadBalancerCookieStickinessPolicy, updates interface{}) (*LoadBalancerCookieStickinessPolicy, error) { - resp := &LoadBalancerCookieStickinessPolicy{} - err := c.rancherClient.doUpdate(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LoadBalancerCookieStickinessPolicyClient) List(opts *ListOpts) (*LoadBalancerCookieStickinessPolicyCollection, error) { - resp := &LoadBalancerCookieStickinessPolicyCollection{} - err := c.rancherClient.doList(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LoadBalancerCookieStickinessPolicyCollection) Next() (*LoadBalancerCookieStickinessPolicyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LoadBalancerCookieStickinessPolicyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LoadBalancerCookieStickinessPolicyClient) ById(id string) (*LoadBalancerCookieStickinessPolicy, error) { - resp := &LoadBalancerCookieStickinessPolicy{} - err := c.rancherClient.doById(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LoadBalancerCookieStickinessPolicyClient) Delete(container *LoadBalancerCookieStickinessPolicy) error { - return c.rancherClient.doResourceDelete(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go deleted file mode 100644 index 941ccb0..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go +++ /dev/null @@ -1,297 +0,0 @@ -package client - -const ( - LOAD_BALANCER_SERVICE_TYPE = "loadBalancerService" -) - -type LoadBalancerService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LbConfig *LbConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` - - Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` - - ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` - - SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` -} - -type LoadBalancerServiceCollection struct { - Collection - Data []LoadBalancerService `json:"data,omitempty"` - client *LoadBalancerServiceClient -} - -type LoadBalancerServiceClient struct { - rancherClient *RancherClient -} - -type LoadBalancerServiceOperations interface { - List(opts *ListOpts) (*LoadBalancerServiceCollection, error) - Create(opts *LoadBalancerService) (*LoadBalancerService, error) - Update(existing *LoadBalancerService, updates interface{}) (*LoadBalancerService, error) - ById(id string) (*LoadBalancerService, error) - Delete(container *LoadBalancerService) error - - ActionActivate(*LoadBalancerService) (*Service, error) - - ActionAddservicelink(*LoadBalancerService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionCancelupgrade(*LoadBalancerService) (*Service, error) - - ActionContinueupgrade(*LoadBalancerService) (*Service, error) - - ActionCreate(*LoadBalancerService) (*Service, error) - - ActionDeactivate(*LoadBalancerService) (*Service, error) - - ActionFinishupgrade(*LoadBalancerService) (*Service, error) - - ActionRemove(*LoadBalancerService) (*Service, error) - - ActionRemoveservicelink(*LoadBalancerService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionRestart(*LoadBalancerService, *ServiceRestart) (*Service, error) - - ActionRollback(*LoadBalancerService) (*Service, error) - - ActionSetservicelinks(*LoadBalancerService, *SetServiceLinksInput) (*Service, error) - - ActionUpdate(*LoadBalancerService) (*Service, error) - - ActionUpgrade(*LoadBalancerService, *ServiceUpgrade) (*Service, error) -} - -func newLoadBalancerServiceClient(rancherClient *RancherClient) *LoadBalancerServiceClient { - return &LoadBalancerServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *LoadBalancerServiceClient) Create(container *LoadBalancerService) (*LoadBalancerService, error) { - resp := &LoadBalancerService{} - err := c.rancherClient.doCreate(LOAD_BALANCER_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *LoadBalancerServiceClient) Update(existing *LoadBalancerService, updates interface{}) (*LoadBalancerService, error) { - resp := &LoadBalancerService{} - err := c.rancherClient.doUpdate(LOAD_BALANCER_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LoadBalancerServiceClient) List(opts *ListOpts) (*LoadBalancerServiceCollection, error) { - resp := &LoadBalancerServiceCollection{} - err := c.rancherClient.doList(LOAD_BALANCER_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LoadBalancerServiceCollection) Next() (*LoadBalancerServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LoadBalancerServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LoadBalancerServiceClient) ById(id string) (*LoadBalancerService, error) { - resp := &LoadBalancerService{} - err := c.rancherClient.doById(LOAD_BALANCER_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LoadBalancerServiceClient) Delete(container *LoadBalancerService) error { - return c.rancherClient.doResourceDelete(LOAD_BALANCER_SERVICE_TYPE, &container.Resource) -} - -func (c *LoadBalancerServiceClient) ActionActivate(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionAddservicelink(resource *LoadBalancerService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionCancelupgrade(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionContinueupgrade(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionCreate(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionDeactivate(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionFinishupgrade(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionRemove(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionRemoveservicelink(resource *LoadBalancerService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionRestart(resource *LoadBalancerService, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionRollback(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionSetservicelinks(resource *LoadBalancerService, input *SetServiceLinksInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionUpdate(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionUpgrade(resource *LoadBalancerService, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go deleted file mode 100644 index 664f137..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - LOCAL_AUTH_CONFIG_TYPE = "localAuthConfig" -) - -type LocalAuthConfig struct { - Resource - - AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` - - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Password string `json:"password,omitempty" yaml:"password,omitempty"` - - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} - -type LocalAuthConfigCollection struct { - Collection - Data []LocalAuthConfig `json:"data,omitempty"` - client *LocalAuthConfigClient -} - -type LocalAuthConfigClient struct { - rancherClient *RancherClient -} - -type LocalAuthConfigOperations interface { - List(opts *ListOpts) (*LocalAuthConfigCollection, error) - Create(opts *LocalAuthConfig) (*LocalAuthConfig, error) - Update(existing *LocalAuthConfig, updates interface{}) (*LocalAuthConfig, error) - ById(id string) (*LocalAuthConfig, error) - Delete(container *LocalAuthConfig) error -} - -func newLocalAuthConfigClient(rancherClient *RancherClient) *LocalAuthConfigClient { - return &LocalAuthConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *LocalAuthConfigClient) Create(container *LocalAuthConfig) (*LocalAuthConfig, error) { - resp := &LocalAuthConfig{} - err := c.rancherClient.doCreate(LOCAL_AUTH_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *LocalAuthConfigClient) Update(existing *LocalAuthConfig, updates interface{}) (*LocalAuthConfig, error) { - resp := &LocalAuthConfig{} - err := c.rancherClient.doUpdate(LOCAL_AUTH_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LocalAuthConfigClient) List(opts *ListOpts) (*LocalAuthConfigCollection, error) { - resp := &LocalAuthConfigCollection{} - err := c.rancherClient.doList(LOCAL_AUTH_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LocalAuthConfigCollection) Next() (*LocalAuthConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LocalAuthConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LocalAuthConfigClient) ById(id string) (*LocalAuthConfig, error) { - resp := &LocalAuthConfig{} - err := c.rancherClient.doById(LOCAL_AUTH_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LocalAuthConfigClient) Delete(container *LocalAuthConfig) error { - return c.rancherClient.doResourceDelete(LOCAL_AUTH_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_log_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_log_config.go deleted file mode 100644 index 3f799aa..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_log_config.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - LOG_CONFIG_TYPE = "logConfig" -) - -type LogConfig struct { - Resource - - Config map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` -} - -type LogConfigCollection struct { - Collection - Data []LogConfig `json:"data,omitempty"` - client *LogConfigClient -} - -type LogConfigClient struct { - rancherClient *RancherClient -} - -type LogConfigOperations interface { - List(opts *ListOpts) (*LogConfigCollection, error) - Create(opts *LogConfig) (*LogConfig, error) - Update(existing *LogConfig, updates interface{}) (*LogConfig, error) - ById(id string) (*LogConfig, error) - Delete(container *LogConfig) error -} - -func newLogConfigClient(rancherClient *RancherClient) *LogConfigClient { - return &LogConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *LogConfigClient) Create(container *LogConfig) (*LogConfig, error) { - resp := &LogConfig{} - err := c.rancherClient.doCreate(LOG_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *LogConfigClient) Update(existing *LogConfig, updates interface{}) (*LogConfig, error) { - resp := &LogConfig{} - err := c.rancherClient.doUpdate(LOG_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LogConfigClient) List(opts *ListOpts) (*LogConfigCollection, error) { - resp := &LogConfigCollection{} - err := c.rancherClient.doList(LOG_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LogConfigCollection) Next() (*LogConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LogConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LogConfigClient) ById(id string) (*LogConfig, error) { - resp := &LogConfig{} - err := c.rancherClient.doById(LOG_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LogConfigClient) Delete(container *LogConfig) error { - return c.rancherClient.doResourceDelete(LOG_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_machine.go b/vendor/github.com/rancher/go-rancher/v2/generated_machine.go deleted file mode 100644 index 5931b98..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_machine.go +++ /dev/null @@ -1,194 +0,0 @@ -package client - -const ( - MACHINE_TYPE = "machine" -) - -type Machine struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Amazonec2Config *Amazonec2Config `json:"amazonec2Config,omitempty" yaml:"amazonec2config,omitempty"` - - AuthCertificateAuthority string `json:"authCertificateAuthority,omitempty" yaml:"auth_certificate_authority,omitempty"` - - AuthKey string `json:"authKey,omitempty" yaml:"auth_key,omitempty"` - - AzureConfig *AzureConfig `json:"azureConfig,omitempty" yaml:"azure_config,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DigitaloceanConfig *DigitaloceanConfig `json:"digitaloceanConfig,omitempty" yaml:"digitalocean_config,omitempty"` - - DockerVersion string `json:"dockerVersion,omitempty" yaml:"docker_version,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - EngineEnv map[string]interface{} `json:"engineEnv,omitempty" yaml:"engine_env,omitempty"` - - EngineInsecureRegistry []string `json:"engineInsecureRegistry,omitempty" yaml:"engine_insecure_registry,omitempty"` - - EngineInstallUrl string `json:"engineInstallUrl,omitempty" yaml:"engine_install_url,omitempty"` - - EngineLabel map[string]interface{} `json:"engineLabel,omitempty" yaml:"engine_label,omitempty"` - - EngineOpt map[string]interface{} `json:"engineOpt,omitempty" yaml:"engine_opt,omitempty"` - - EngineRegistryMirror []string `json:"engineRegistryMirror,omitempty" yaml:"engine_registry_mirror,omitempty"` - - EngineStorageDriver string `json:"engineStorageDriver,omitempty" yaml:"engine_storage_driver,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HostTemplateId string `json:"hostTemplateId,omitempty" yaml:"host_template_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PacketConfig *PacketConfig `json:"packetConfig,omitempty" yaml:"packet_config,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type MachineCollection struct { - Collection - Data []Machine `json:"data,omitempty"` - client *MachineClient -} - -type MachineClient struct { - rancherClient *RancherClient -} - -type MachineOperations interface { - List(opts *ListOpts) (*MachineCollection, error) - Create(opts *Machine) (*Machine, error) - Update(existing *Machine, updates interface{}) (*Machine, error) - ById(id string) (*Machine, error) - Delete(container *Machine) error - - ActionBootstrap(*Machine) (*PhysicalHost, error) - - ActionCreate(*Machine) (*PhysicalHost, error) - - ActionError(*Machine) (*PhysicalHost, error) - - ActionRemove(*Machine) (*PhysicalHost, error) - - ActionUpdate(*Machine) (*PhysicalHost, error) -} - -func newMachineClient(rancherClient *RancherClient) *MachineClient { - return &MachineClient{ - rancherClient: rancherClient, - } -} - -func (c *MachineClient) Create(container *Machine) (*Machine, error) { - resp := &Machine{} - err := c.rancherClient.doCreate(MACHINE_TYPE, container, resp) - return resp, err -} - -func (c *MachineClient) Update(existing *Machine, updates interface{}) (*Machine, error) { - resp := &Machine{} - err := c.rancherClient.doUpdate(MACHINE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MachineClient) List(opts *ListOpts) (*MachineCollection, error) { - resp := &MachineCollection{} - err := c.rancherClient.doList(MACHINE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *MachineCollection) Next() (*MachineCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &MachineCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *MachineClient) ById(id string) (*Machine, error) { - resp := &Machine{} - err := c.rancherClient.doById(MACHINE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *MachineClient) Delete(container *Machine) error { - return c.rancherClient.doResourceDelete(MACHINE_TYPE, &container.Resource) -} - -func (c *MachineClient) ActionBootstrap(resource *Machine) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(MACHINE_TYPE, "bootstrap", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineClient) ActionCreate(resource *Machine) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(MACHINE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineClient) ActionError(resource *Machine) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(MACHINE_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineClient) ActionRemove(resource *Machine) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(MACHINE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineClient) ActionUpdate(resource *Machine) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(MACHINE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go b/vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go deleted file mode 100644 index a0b7065..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go +++ /dev/null @@ -1,192 +0,0 @@ -package client - -const ( - MACHINE_DRIVER_TYPE = "machineDriver" -) - -type MachineDriver struct { - Resource - - ActivateOnCreate bool `json:"activateOnCreate,omitempty" yaml:"activate_on_create,omitempty"` - - Builtin bool `json:"builtin,omitempty" yaml:"builtin,omitempty"` - - Checksum string `json:"checksum,omitempty" yaml:"checksum,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DefaultActive bool `json:"defaultActive,omitempty" yaml:"default_active,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - UiUrl string `json:"uiUrl,omitempty" yaml:"ui_url,omitempty"` - - Url string `json:"url,omitempty" yaml:"url,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type MachineDriverCollection struct { - Collection - Data []MachineDriver `json:"data,omitempty"` - client *MachineDriverClient -} - -type MachineDriverClient struct { - rancherClient *RancherClient -} - -type MachineDriverOperations interface { - List(opts *ListOpts) (*MachineDriverCollection, error) - Create(opts *MachineDriver) (*MachineDriver, error) - Update(existing *MachineDriver, updates interface{}) (*MachineDriver, error) - ById(id string) (*MachineDriver, error) - Delete(container *MachineDriver) error - - ActionActivate(*MachineDriver) (*MachineDriver, error) - - ActionCreate(*MachineDriver) (*MachineDriver, error) - - ActionDeactivate(*MachineDriver) (*MachineDriver, error) - - ActionError(*MachineDriver) (*MachineDriver, error) - - ActionReactivate(*MachineDriver) (*MachineDriver, error) - - ActionRemove(*MachineDriver) (*MachineDriver, error) - - ActionUpdate(*MachineDriver) (*MachineDriver, error) -} - -func newMachineDriverClient(rancherClient *RancherClient) *MachineDriverClient { - return &MachineDriverClient{ - rancherClient: rancherClient, - } -} - -func (c *MachineDriverClient) Create(container *MachineDriver) (*MachineDriver, error) { - resp := &MachineDriver{} - err := c.rancherClient.doCreate(MACHINE_DRIVER_TYPE, container, resp) - return resp, err -} - -func (c *MachineDriverClient) Update(existing *MachineDriver, updates interface{}) (*MachineDriver, error) { - resp := &MachineDriver{} - err := c.rancherClient.doUpdate(MACHINE_DRIVER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MachineDriverClient) List(opts *ListOpts) (*MachineDriverCollection, error) { - resp := &MachineDriverCollection{} - err := c.rancherClient.doList(MACHINE_DRIVER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *MachineDriverCollection) Next() (*MachineDriverCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &MachineDriverCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *MachineDriverClient) ById(id string) (*MachineDriver, error) { - resp := &MachineDriver{} - err := c.rancherClient.doById(MACHINE_DRIVER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *MachineDriverClient) Delete(container *MachineDriver) error { - return c.rancherClient.doResourceDelete(MACHINE_DRIVER_TYPE, &container.Resource) -} - -func (c *MachineDriverClient) ActionActivate(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineDriverClient) ActionCreate(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineDriverClient) ActionDeactivate(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineDriverClient) ActionError(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineDriverClient) ActionReactivate(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "reactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineDriverClient) ActionRemove(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineDriverClient) ActionUpdate(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_mount.go b/vendor/github.com/rancher/go-rancher/v2/generated_mount.go deleted file mode 100644 index efa68a5..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_mount.go +++ /dev/null @@ -1,144 +0,0 @@ -package client - -const ( - MOUNT_TYPE = "mount" -) - -type Mount struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Path string `json:"path,omitempty" yaml:"path,omitempty"` - - Permissions string `json:"permissions,omitempty" yaml:"permissions,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` -} - -type MountCollection struct { - Collection - Data []Mount `json:"data,omitempty"` - client *MountClient -} - -type MountClient struct { - rancherClient *RancherClient -} - -type MountOperations interface { - List(opts *ListOpts) (*MountCollection, error) - Create(opts *Mount) (*Mount, error) - Update(existing *Mount, updates interface{}) (*Mount, error) - ById(id string) (*Mount, error) - Delete(container *Mount) error - - ActionCreate(*Mount) (*Mount, error) - - ActionDeactivate(*Mount) (*Mount, error) - - ActionRemove(*Mount) (*Mount, error) -} - -func newMountClient(rancherClient *RancherClient) *MountClient { - return &MountClient{ - rancherClient: rancherClient, - } -} - -func (c *MountClient) Create(container *Mount) (*Mount, error) { - resp := &Mount{} - err := c.rancherClient.doCreate(MOUNT_TYPE, container, resp) - return resp, err -} - -func (c *MountClient) Update(existing *Mount, updates interface{}) (*Mount, error) { - resp := &Mount{} - err := c.rancherClient.doUpdate(MOUNT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MountClient) List(opts *ListOpts) (*MountCollection, error) { - resp := &MountCollection{} - err := c.rancherClient.doList(MOUNT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *MountCollection) Next() (*MountCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &MountCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *MountClient) ById(id string) (*Mount, error) { - resp := &Mount{} - err := c.rancherClient.doById(MOUNT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *MountClient) Delete(container *Mount) error { - return c.rancherClient.doResourceDelete(MOUNT_TYPE, &container.Resource) -} - -func (c *MountClient) ActionCreate(resource *Mount) (*Mount, error) { - - resp := &Mount{} - - err := c.rancherClient.doAction(MOUNT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MountClient) ActionDeactivate(resource *Mount) (*Mount, error) { - - resp := &Mount{} - - err := c.rancherClient.doAction(MOUNT_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MountClient) ActionRemove(resource *Mount) (*Mount, error) { - - resp := &Mount{} - - err := c.rancherClient.doAction(MOUNT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go b/vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go deleted file mode 100644 index 62d4f4f..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - MOUNT_ENTRY_TYPE = "mountEntry" -) - -type MountEntry struct { - Resource - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - InstanceName string `json:"instanceName,omitempty" yaml:"instance_name,omitempty"` - - Path string `json:"path,omitempty" yaml:"path,omitempty"` - - VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` - - VolumeName string `json:"volumeName,omitempty" yaml:"volume_name,omitempty"` -} - -type MountEntryCollection struct { - Collection - Data []MountEntry `json:"data,omitempty"` - client *MountEntryClient -} - -type MountEntryClient struct { - rancherClient *RancherClient -} - -type MountEntryOperations interface { - List(opts *ListOpts) (*MountEntryCollection, error) - Create(opts *MountEntry) (*MountEntry, error) - Update(existing *MountEntry, updates interface{}) (*MountEntry, error) - ById(id string) (*MountEntry, error) - Delete(container *MountEntry) error -} - -func newMountEntryClient(rancherClient *RancherClient) *MountEntryClient { - return &MountEntryClient{ - rancherClient: rancherClient, - } -} - -func (c *MountEntryClient) Create(container *MountEntry) (*MountEntry, error) { - resp := &MountEntry{} - err := c.rancherClient.doCreate(MOUNT_ENTRY_TYPE, container, resp) - return resp, err -} - -func (c *MountEntryClient) Update(existing *MountEntry, updates interface{}) (*MountEntry, error) { - resp := &MountEntry{} - err := c.rancherClient.doUpdate(MOUNT_ENTRY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MountEntryClient) List(opts *ListOpts) (*MountEntryCollection, error) { - resp := &MountEntryCollection{} - err := c.rancherClient.doList(MOUNT_ENTRY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *MountEntryCollection) Next() (*MountEntryCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &MountEntryCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *MountEntryClient) ById(id string) (*MountEntry, error) { - resp := &MountEntry{} - err := c.rancherClient.doById(MOUNT_ENTRY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *MountEntryClient) Delete(container *MountEntry) error { - return c.rancherClient.doResourceDelete(MOUNT_ENTRY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network.go b/vendor/github.com/rancher/go-rancher/v2/generated_network.go deleted file mode 100644 index ce77246..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network.go +++ /dev/null @@ -1,185 +0,0 @@ -package client - -const ( - NETWORK_TYPE = "network" -) - -type Network struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DefaultPolicyAction string `json:"defaultPolicyAction,omitempty" yaml:"default_policy_action,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` - - HostPorts bool `json:"hostPorts,omitempty" yaml:"host_ports,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NetworkDriverId string `json:"networkDriverId,omitempty" yaml:"network_driver_id,omitempty"` - - Policy []NetworkPolicyRule `json:"policy,omitempty" yaml:"policy,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Subnets []Subnet `json:"subnets,omitempty" yaml:"subnets,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type NetworkCollection struct { - Collection - Data []Network `json:"data,omitempty"` - client *NetworkClient -} - -type NetworkClient struct { - rancherClient *RancherClient -} - -type NetworkOperations interface { - List(opts *ListOpts) (*NetworkCollection, error) - Create(opts *Network) (*Network, error) - Update(existing *Network, updates interface{}) (*Network, error) - ById(id string) (*Network, error) - Delete(container *Network) error - - ActionActivate(*Network) (*Network, error) - - ActionCreate(*Network) (*Network, error) - - ActionDeactivate(*Network) (*Network, error) - - ActionPurge(*Network) (*Network, error) - - ActionRemove(*Network) (*Network, error) - - ActionUpdate(*Network) (*Network, error) -} - -func newNetworkClient(rancherClient *RancherClient) *NetworkClient { - return &NetworkClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkClient) Create(container *Network) (*Network, error) { - resp := &Network{} - err := c.rancherClient.doCreate(NETWORK_TYPE, container, resp) - return resp, err -} - -func (c *NetworkClient) Update(existing *Network, updates interface{}) (*Network, error) { - resp := &Network{} - err := c.rancherClient.doUpdate(NETWORK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkClient) List(opts *ListOpts) (*NetworkCollection, error) { - resp := &NetworkCollection{} - err := c.rancherClient.doList(NETWORK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkCollection) Next() (*NetworkCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkClient) ById(id string) (*Network, error) { - resp := &Network{} - err := c.rancherClient.doById(NETWORK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkClient) Delete(container *Network) error { - return c.rancherClient.doResourceDelete(NETWORK_TYPE, &container.Resource) -} - -func (c *NetworkClient) ActionActivate(resource *Network) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(NETWORK_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkClient) ActionCreate(resource *Network) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(NETWORK_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkClient) ActionDeactivate(resource *Network) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(NETWORK_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkClient) ActionPurge(resource *Network) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(NETWORK_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkClient) ActionRemove(resource *Network) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(NETWORK_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkClient) ActionUpdate(resource *Network) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(NETWORK_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go deleted file mode 100644 index ea35cfe..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go +++ /dev/null @@ -1,166 +0,0 @@ -package client - -const ( - NETWORK_DRIVER_TYPE = "networkDriver" -) - -type NetworkDriver struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - CniConfig map[string]interface{} `json:"cniConfig,omitempty" yaml:"cni_config,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DefaultNetwork DefaultNetwork `json:"defaultNetwork,omitempty" yaml:"default_network,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NetworkMetadata map[string]interface{} `json:"networkMetadata,omitempty" yaml:"network_metadata,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type NetworkDriverCollection struct { - Collection - Data []NetworkDriver `json:"data,omitempty"` - client *NetworkDriverClient -} - -type NetworkDriverClient struct { - rancherClient *RancherClient -} - -type NetworkDriverOperations interface { - List(opts *ListOpts) (*NetworkDriverCollection, error) - Create(opts *NetworkDriver) (*NetworkDriver, error) - Update(existing *NetworkDriver, updates interface{}) (*NetworkDriver, error) - ById(id string) (*NetworkDriver, error) - Delete(container *NetworkDriver) error - - ActionActivate(*NetworkDriver) (*NetworkDriver, error) - - ActionCreate(*NetworkDriver) (*NetworkDriver, error) - - ActionDeactivate(*NetworkDriver) (*NetworkDriver, error) - - ActionRemove(*NetworkDriver) (*NetworkDriver, error) - - ActionUpdate(*NetworkDriver) (*NetworkDriver, error) -} - -func newNetworkDriverClient(rancherClient *RancherClient) *NetworkDriverClient { - return &NetworkDriverClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkDriverClient) Create(container *NetworkDriver) (*NetworkDriver, error) { - resp := &NetworkDriver{} - err := c.rancherClient.doCreate(NETWORK_DRIVER_TYPE, container, resp) - return resp, err -} - -func (c *NetworkDriverClient) Update(existing *NetworkDriver, updates interface{}) (*NetworkDriver, error) { - resp := &NetworkDriver{} - err := c.rancherClient.doUpdate(NETWORK_DRIVER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkDriverClient) List(opts *ListOpts) (*NetworkDriverCollection, error) { - resp := &NetworkDriverCollection{} - err := c.rancherClient.doList(NETWORK_DRIVER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkDriverCollection) Next() (*NetworkDriverCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkDriverCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkDriverClient) ById(id string) (*NetworkDriver, error) { - resp := &NetworkDriver{} - err := c.rancherClient.doById(NETWORK_DRIVER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkDriverClient) Delete(container *NetworkDriver) error { - return c.rancherClient.doResourceDelete(NETWORK_DRIVER_TYPE, &container.Resource) -} - -func (c *NetworkDriverClient) ActionActivate(resource *NetworkDriver) (*NetworkDriver, error) { - - resp := &NetworkDriver{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverClient) ActionCreate(resource *NetworkDriver) (*NetworkDriver, error) { - - resp := &NetworkDriver{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverClient) ActionDeactivate(resource *NetworkDriver) (*NetworkDriver, error) { - - resp := &NetworkDriver{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverClient) ActionRemove(resource *NetworkDriver) (*NetworkDriver, error) { - - resp := &NetworkDriver{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverClient) ActionUpdate(resource *NetworkDriver) (*NetworkDriver, error) { - - resp := &NetworkDriver{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go deleted file mode 100644 index 9317af3..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go +++ /dev/null @@ -1,305 +0,0 @@ -package client - -const ( - NETWORK_DRIVER_SERVICE_TYPE = "networkDriverService" -) - -type NetworkDriverService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LbConfig *LbTargetConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NetworkDriver NetworkDriver `json:"networkDriver,omitempty" yaml:"network_driver,omitempty"` - - PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` - - Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` - - ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` - - SecondaryLaunchConfigs []SecondaryLaunchConfig `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` - - SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` - - SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` -} - -type NetworkDriverServiceCollection struct { - Collection - Data []NetworkDriverService `json:"data,omitempty"` - client *NetworkDriverServiceClient -} - -type NetworkDriverServiceClient struct { - rancherClient *RancherClient -} - -type NetworkDriverServiceOperations interface { - List(opts *ListOpts) (*NetworkDriverServiceCollection, error) - Create(opts *NetworkDriverService) (*NetworkDriverService, error) - Update(existing *NetworkDriverService, updates interface{}) (*NetworkDriverService, error) - ById(id string) (*NetworkDriverService, error) - Delete(container *NetworkDriverService) error - - ActionActivate(*NetworkDriverService) (*Service, error) - - ActionAddservicelink(*NetworkDriverService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionCancelupgrade(*NetworkDriverService) (*Service, error) - - ActionContinueupgrade(*NetworkDriverService) (*Service, error) - - ActionCreate(*NetworkDriverService) (*Service, error) - - ActionDeactivate(*NetworkDriverService) (*Service, error) - - ActionFinishupgrade(*NetworkDriverService) (*Service, error) - - ActionRemove(*NetworkDriverService) (*Service, error) - - ActionRemoveservicelink(*NetworkDriverService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionRestart(*NetworkDriverService, *ServiceRestart) (*Service, error) - - ActionRollback(*NetworkDriverService) (*Service, error) - - ActionSetservicelinks(*NetworkDriverService, *SetServiceLinksInput) (*Service, error) - - ActionUpdate(*NetworkDriverService) (*Service, error) - - ActionUpgrade(*NetworkDriverService, *ServiceUpgrade) (*Service, error) -} - -func newNetworkDriverServiceClient(rancherClient *RancherClient) *NetworkDriverServiceClient { - return &NetworkDriverServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkDriverServiceClient) Create(container *NetworkDriverService) (*NetworkDriverService, error) { - resp := &NetworkDriverService{} - err := c.rancherClient.doCreate(NETWORK_DRIVER_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *NetworkDriverServiceClient) Update(existing *NetworkDriverService, updates interface{}) (*NetworkDriverService, error) { - resp := &NetworkDriverService{} - err := c.rancherClient.doUpdate(NETWORK_DRIVER_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkDriverServiceClient) List(opts *ListOpts) (*NetworkDriverServiceCollection, error) { - resp := &NetworkDriverServiceCollection{} - err := c.rancherClient.doList(NETWORK_DRIVER_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkDriverServiceCollection) Next() (*NetworkDriverServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkDriverServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkDriverServiceClient) ById(id string) (*NetworkDriverService, error) { - resp := &NetworkDriverService{} - err := c.rancherClient.doById(NETWORK_DRIVER_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkDriverServiceClient) Delete(container *NetworkDriverService) error { - return c.rancherClient.doResourceDelete(NETWORK_DRIVER_SERVICE_TYPE, &container.Resource) -} - -func (c *NetworkDriverServiceClient) ActionActivate(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionAddservicelink(resource *NetworkDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionCancelupgrade(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionContinueupgrade(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionCreate(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionDeactivate(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionFinishupgrade(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionRemove(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionRemoveservicelink(resource *NetworkDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionRestart(resource *NetworkDriverService, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionRollback(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionSetservicelinks(resource *NetworkDriverService, input *SetServiceLinksInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionUpdate(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionUpgrade(resource *NetworkDriverService, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule.go deleted file mode 100644 index 6f62f28..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule.go +++ /dev/null @@ -1,89 +0,0 @@ -package client - -const ( - NETWORK_POLICY_RULE_TYPE = "networkPolicyRule" -) - -type NetworkPolicyRule struct { - Resource - - Action string `json:"action,omitempty" yaml:"action,omitempty"` - - Between NetworkPolicyRuleBetween `json:"between,omitempty" yaml:"between,omitempty"` - - From NetworkPolicyRuleMember `json:"from,omitempty" yaml:"from,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - To NetworkPolicyRuleMember `json:"to,omitempty" yaml:"to,omitempty"` - - Within string `json:"within,omitempty" yaml:"within,omitempty"` -} - -type NetworkPolicyRuleCollection struct { - Collection - Data []NetworkPolicyRule `json:"data,omitempty"` - client *NetworkPolicyRuleClient -} - -type NetworkPolicyRuleClient struct { - rancherClient *RancherClient -} - -type NetworkPolicyRuleOperations interface { - List(opts *ListOpts) (*NetworkPolicyRuleCollection, error) - Create(opts *NetworkPolicyRule) (*NetworkPolicyRule, error) - Update(existing *NetworkPolicyRule, updates interface{}) (*NetworkPolicyRule, error) - ById(id string) (*NetworkPolicyRule, error) - Delete(container *NetworkPolicyRule) error -} - -func newNetworkPolicyRuleClient(rancherClient *RancherClient) *NetworkPolicyRuleClient { - return &NetworkPolicyRuleClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkPolicyRuleClient) Create(container *NetworkPolicyRule) (*NetworkPolicyRule, error) { - resp := &NetworkPolicyRule{} - err := c.rancherClient.doCreate(NETWORK_POLICY_RULE_TYPE, container, resp) - return resp, err -} - -func (c *NetworkPolicyRuleClient) Update(existing *NetworkPolicyRule, updates interface{}) (*NetworkPolicyRule, error) { - resp := &NetworkPolicyRule{} - err := c.rancherClient.doUpdate(NETWORK_POLICY_RULE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkPolicyRuleClient) List(opts *ListOpts) (*NetworkPolicyRuleCollection, error) { - resp := &NetworkPolicyRuleCollection{} - err := c.rancherClient.doList(NETWORK_POLICY_RULE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkPolicyRuleCollection) Next() (*NetworkPolicyRuleCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkPolicyRuleCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkPolicyRuleClient) ById(id string) (*NetworkPolicyRule, error) { - resp := &NetworkPolicyRule{} - err := c.rancherClient.doById(NETWORK_POLICY_RULE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkPolicyRuleClient) Delete(container *NetworkPolicyRule) error { - return c.rancherClient.doResourceDelete(NETWORK_POLICY_RULE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_between.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_between.go deleted file mode 100644 index 77e1766..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_between.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - NETWORK_POLICY_RULE_BETWEEN_TYPE = "networkPolicyRuleBetween" -) - -type NetworkPolicyRuleBetween struct { - Resource - - GroupBy string `json:"groupBy,omitempty" yaml:"group_by,omitempty"` - - Selector string `json:"selector,omitempty" yaml:"selector,omitempty"` -} - -type NetworkPolicyRuleBetweenCollection struct { - Collection - Data []NetworkPolicyRuleBetween `json:"data,omitempty"` - client *NetworkPolicyRuleBetweenClient -} - -type NetworkPolicyRuleBetweenClient struct { - rancherClient *RancherClient -} - -type NetworkPolicyRuleBetweenOperations interface { - List(opts *ListOpts) (*NetworkPolicyRuleBetweenCollection, error) - Create(opts *NetworkPolicyRuleBetween) (*NetworkPolicyRuleBetween, error) - Update(existing *NetworkPolicyRuleBetween, updates interface{}) (*NetworkPolicyRuleBetween, error) - ById(id string) (*NetworkPolicyRuleBetween, error) - Delete(container *NetworkPolicyRuleBetween) error -} - -func newNetworkPolicyRuleBetweenClient(rancherClient *RancherClient) *NetworkPolicyRuleBetweenClient { - return &NetworkPolicyRuleBetweenClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkPolicyRuleBetweenClient) Create(container *NetworkPolicyRuleBetween) (*NetworkPolicyRuleBetween, error) { - resp := &NetworkPolicyRuleBetween{} - err := c.rancherClient.doCreate(NETWORK_POLICY_RULE_BETWEEN_TYPE, container, resp) - return resp, err -} - -func (c *NetworkPolicyRuleBetweenClient) Update(existing *NetworkPolicyRuleBetween, updates interface{}) (*NetworkPolicyRuleBetween, error) { - resp := &NetworkPolicyRuleBetween{} - err := c.rancherClient.doUpdate(NETWORK_POLICY_RULE_BETWEEN_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkPolicyRuleBetweenClient) List(opts *ListOpts) (*NetworkPolicyRuleBetweenCollection, error) { - resp := &NetworkPolicyRuleBetweenCollection{} - err := c.rancherClient.doList(NETWORK_POLICY_RULE_BETWEEN_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkPolicyRuleBetweenCollection) Next() (*NetworkPolicyRuleBetweenCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkPolicyRuleBetweenCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkPolicyRuleBetweenClient) ById(id string) (*NetworkPolicyRuleBetween, error) { - resp := &NetworkPolicyRuleBetween{} - err := c.rancherClient.doById(NETWORK_POLICY_RULE_BETWEEN_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkPolicyRuleBetweenClient) Delete(container *NetworkPolicyRuleBetween) error { - return c.rancherClient.doResourceDelete(NETWORK_POLICY_RULE_BETWEEN_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_member.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_member.go deleted file mode 100644 index e8e34e1..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_member.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - NETWORK_POLICY_RULE_MEMBER_TYPE = "networkPolicyRuleMember" -) - -type NetworkPolicyRuleMember struct { - Resource - - Selector string `json:"selector,omitempty" yaml:"selector,omitempty"` -} - -type NetworkPolicyRuleMemberCollection struct { - Collection - Data []NetworkPolicyRuleMember `json:"data,omitempty"` - client *NetworkPolicyRuleMemberClient -} - -type NetworkPolicyRuleMemberClient struct { - rancherClient *RancherClient -} - -type NetworkPolicyRuleMemberOperations interface { - List(opts *ListOpts) (*NetworkPolicyRuleMemberCollection, error) - Create(opts *NetworkPolicyRuleMember) (*NetworkPolicyRuleMember, error) - Update(existing *NetworkPolicyRuleMember, updates interface{}) (*NetworkPolicyRuleMember, error) - ById(id string) (*NetworkPolicyRuleMember, error) - Delete(container *NetworkPolicyRuleMember) error -} - -func newNetworkPolicyRuleMemberClient(rancherClient *RancherClient) *NetworkPolicyRuleMemberClient { - return &NetworkPolicyRuleMemberClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkPolicyRuleMemberClient) Create(container *NetworkPolicyRuleMember) (*NetworkPolicyRuleMember, error) { - resp := &NetworkPolicyRuleMember{} - err := c.rancherClient.doCreate(NETWORK_POLICY_RULE_MEMBER_TYPE, container, resp) - return resp, err -} - -func (c *NetworkPolicyRuleMemberClient) Update(existing *NetworkPolicyRuleMember, updates interface{}) (*NetworkPolicyRuleMember, error) { - resp := &NetworkPolicyRuleMember{} - err := c.rancherClient.doUpdate(NETWORK_POLICY_RULE_MEMBER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkPolicyRuleMemberClient) List(opts *ListOpts) (*NetworkPolicyRuleMemberCollection, error) { - resp := &NetworkPolicyRuleMemberCollection{} - err := c.rancherClient.doList(NETWORK_POLICY_RULE_MEMBER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkPolicyRuleMemberCollection) Next() (*NetworkPolicyRuleMemberCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkPolicyRuleMemberCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkPolicyRuleMemberClient) ById(id string) (*NetworkPolicyRuleMember, error) { - resp := &NetworkPolicyRuleMember{} - err := c.rancherClient.doById(NETWORK_POLICY_RULE_MEMBER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkPolicyRuleMemberClient) Delete(container *NetworkPolicyRuleMember) error { - return c.rancherClient.doResourceDelete(NETWORK_POLICY_RULE_MEMBER_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_within.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_within.go deleted file mode 100644 index 0472ee6..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_within.go +++ /dev/null @@ -1,77 +0,0 @@ -package client - -const ( - NETWORK_POLICY_RULE_WITHIN_TYPE = "networkPolicyRuleWithin" -) - -type NetworkPolicyRuleWithin struct { - Resource -} - -type NetworkPolicyRuleWithinCollection struct { - Collection - Data []NetworkPolicyRuleWithin `json:"data,omitempty"` - client *NetworkPolicyRuleWithinClient -} - -type NetworkPolicyRuleWithinClient struct { - rancherClient *RancherClient -} - -type NetworkPolicyRuleWithinOperations interface { - List(opts *ListOpts) (*NetworkPolicyRuleWithinCollection, error) - Create(opts *NetworkPolicyRuleWithin) (*NetworkPolicyRuleWithin, error) - Update(existing *NetworkPolicyRuleWithin, updates interface{}) (*NetworkPolicyRuleWithin, error) - ById(id string) (*NetworkPolicyRuleWithin, error) - Delete(container *NetworkPolicyRuleWithin) error -} - -func newNetworkPolicyRuleWithinClient(rancherClient *RancherClient) *NetworkPolicyRuleWithinClient { - return &NetworkPolicyRuleWithinClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkPolicyRuleWithinClient) Create(container *NetworkPolicyRuleWithin) (*NetworkPolicyRuleWithin, error) { - resp := &NetworkPolicyRuleWithin{} - err := c.rancherClient.doCreate(NETWORK_POLICY_RULE_WITHIN_TYPE, container, resp) - return resp, err -} - -func (c *NetworkPolicyRuleWithinClient) Update(existing *NetworkPolicyRuleWithin, updates interface{}) (*NetworkPolicyRuleWithin, error) { - resp := &NetworkPolicyRuleWithin{} - err := c.rancherClient.doUpdate(NETWORK_POLICY_RULE_WITHIN_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkPolicyRuleWithinClient) List(opts *ListOpts) (*NetworkPolicyRuleWithinCollection, error) { - resp := &NetworkPolicyRuleWithinCollection{} - err := c.rancherClient.doList(NETWORK_POLICY_RULE_WITHIN_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkPolicyRuleWithinCollection) Next() (*NetworkPolicyRuleWithinCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkPolicyRuleWithinCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkPolicyRuleWithinClient) ById(id string) (*NetworkPolicyRuleWithin, error) { - resp := &NetworkPolicyRuleWithin{} - err := c.rancherClient.doById(NETWORK_POLICY_RULE_WITHIN_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkPolicyRuleWithinClient) Delete(container *NetworkPolicyRuleWithin) error { - return c.rancherClient.doResourceDelete(NETWORK_POLICY_RULE_WITHIN_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go deleted file mode 100644 index 1c0143f..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - NFS_CONFIG_TYPE = "nfsConfig" -) - -type NfsConfig struct { - Resource - - MountOptions string `json:"mountOptions,omitempty" yaml:"mount_options,omitempty"` - - Server string `json:"server,omitempty" yaml:"server,omitempty"` - - Share string `json:"share,omitempty" yaml:"share,omitempty"` -} - -type NfsConfigCollection struct { - Collection - Data []NfsConfig `json:"data,omitempty"` - client *NfsConfigClient -} - -type NfsConfigClient struct { - rancherClient *RancherClient -} - -type NfsConfigOperations interface { - List(opts *ListOpts) (*NfsConfigCollection, error) - Create(opts *NfsConfig) (*NfsConfig, error) - Update(existing *NfsConfig, updates interface{}) (*NfsConfig, error) - ById(id string) (*NfsConfig, error) - Delete(container *NfsConfig) error -} - -func newNfsConfigClient(rancherClient *RancherClient) *NfsConfigClient { - return &NfsConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *NfsConfigClient) Create(container *NfsConfig) (*NfsConfig, error) { - resp := &NfsConfig{} - err := c.rancherClient.doCreate(NFS_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *NfsConfigClient) Update(existing *NfsConfig, updates interface{}) (*NfsConfig, error) { - resp := &NfsConfig{} - err := c.rancherClient.doUpdate(NFS_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NfsConfigClient) List(opts *ListOpts) (*NfsConfigCollection, error) { - resp := &NfsConfigCollection{} - err := c.rancherClient.doList(NFS_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NfsConfigCollection) Next() (*NfsConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NfsConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NfsConfigClient) ById(id string) (*NfsConfig, error) { - resp := &NfsConfig{} - err := c.rancherClient.doById(NFS_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NfsConfigClient) Delete(container *NfsConfig) error { - return c.rancherClient.doResourceDelete(NFS_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go b/vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go deleted file mode 100644 index baf672a..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go +++ /dev/null @@ -1,129 +0,0 @@ -package client - -const ( - OPENLDAPCONFIG_TYPE = "openldapconfig" -) - -type Openldapconfig struct { - Resource - - AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` - - AllowedIdentities []Identity `json:"allowedIdentities,omitempty" yaml:"allowed_identities,omitempty"` - - ConnectionTimeout int64 `json:"connectionTimeout,omitempty" yaml:"connection_timeout,omitempty"` - - Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` - - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - - GroupDNField string `json:"groupDNField,omitempty" yaml:"group_dnfield,omitempty"` - - GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" yaml:"group_member_mapping_attribute,omitempty"` - - GroupMemberUserAttribute string `json:"groupMemberUserAttribute,omitempty" yaml:"group_member_user_attribute,omitempty"` - - GroupNameField string `json:"groupNameField,omitempty" yaml:"group_name_field,omitempty"` - - GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"group_object_class,omitempty"` - - GroupSearchDomain string `json:"groupSearchDomain,omitempty" yaml:"group_search_domain,omitempty"` - - GroupSearchField string `json:"groupSearchField,omitempty" yaml:"group_search_field,omitempty"` - - LoginDomain string `json:"loginDomain,omitempty" yaml:"login_domain,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - - Server string `json:"server,omitempty" yaml:"server,omitempty"` - - ServiceAccountPassword string `json:"serviceAccountPassword,omitempty" yaml:"service_account_password,omitempty"` - - ServiceAccountUsername string `json:"serviceAccountUsername,omitempty" yaml:"service_account_username,omitempty"` - - Tls bool `json:"tls,omitempty" yaml:"tls,omitempty"` - - UserDisabledBitMask int64 `json:"userDisabledBitMask,omitempty" yaml:"user_disabled_bit_mask,omitempty"` - - UserEnabledAttribute string `json:"userEnabledAttribute,omitempty" yaml:"user_enabled_attribute,omitempty"` - - UserLoginField string `json:"userLoginField,omitempty" yaml:"user_login_field,omitempty"` - - UserMemberAttribute string `json:"userMemberAttribute,omitempty" yaml:"user_member_attribute,omitempty"` - - UserNameField string `json:"userNameField,omitempty" yaml:"user_name_field,omitempty"` - - UserObjectClass string `json:"userObjectClass,omitempty" yaml:"user_object_class,omitempty"` - - UserSearchField string `json:"userSearchField,omitempty" yaml:"user_search_field,omitempty"` -} - -type OpenldapconfigCollection struct { - Collection - Data []Openldapconfig `json:"data,omitempty"` - client *OpenldapconfigClient -} - -type OpenldapconfigClient struct { - rancherClient *RancherClient -} - -type OpenldapconfigOperations interface { - List(opts *ListOpts) (*OpenldapconfigCollection, error) - Create(opts *Openldapconfig) (*Openldapconfig, error) - Update(existing *Openldapconfig, updates interface{}) (*Openldapconfig, error) - ById(id string) (*Openldapconfig, error) - Delete(container *Openldapconfig) error -} - -func newOpenldapconfigClient(rancherClient *RancherClient) *OpenldapconfigClient { - return &OpenldapconfigClient{ - rancherClient: rancherClient, - } -} - -func (c *OpenldapconfigClient) Create(container *Openldapconfig) (*Openldapconfig, error) { - resp := &Openldapconfig{} - err := c.rancherClient.doCreate(OPENLDAPCONFIG_TYPE, container, resp) - return resp, err -} - -func (c *OpenldapconfigClient) Update(existing *Openldapconfig, updates interface{}) (*Openldapconfig, error) { - resp := &Openldapconfig{} - err := c.rancherClient.doUpdate(OPENLDAPCONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *OpenldapconfigClient) List(opts *ListOpts) (*OpenldapconfigCollection, error) { - resp := &OpenldapconfigCollection{} - err := c.rancherClient.doList(OPENLDAPCONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *OpenldapconfigCollection) Next() (*OpenldapconfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &OpenldapconfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *OpenldapconfigClient) ById(id string) (*Openldapconfig, error) { - resp := &Openldapconfig{} - err := c.rancherClient.doById(OPENLDAPCONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *OpenldapconfigClient) Delete(container *Openldapconfig) error { - return c.rancherClient.doResourceDelete(OPENLDAPCONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go deleted file mode 100644 index 3f3c4ff..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go +++ /dev/null @@ -1,89 +0,0 @@ -package client - -const ( - PACKET_CONFIG_TYPE = "packetConfig" -) - -type PacketConfig struct { - Resource - - ApiKey string `json:"apiKey,omitempty" yaml:"api_key,omitempty"` - - BillingCycle string `json:"billingCycle,omitempty" yaml:"billing_cycle,omitempty"` - - FacilityCode string `json:"facilityCode,omitempty" yaml:"facility_code,omitempty"` - - Os string `json:"os,omitempty" yaml:"os,omitempty"` - - Plan string `json:"plan,omitempty" yaml:"plan,omitempty"` - - ProjectId string `json:"projectId,omitempty" yaml:"project_id,omitempty"` -} - -type PacketConfigCollection struct { - Collection - Data []PacketConfig `json:"data,omitempty"` - client *PacketConfigClient -} - -type PacketConfigClient struct { - rancherClient *RancherClient -} - -type PacketConfigOperations interface { - List(opts *ListOpts) (*PacketConfigCollection, error) - Create(opts *PacketConfig) (*PacketConfig, error) - Update(existing *PacketConfig, updates interface{}) (*PacketConfig, error) - ById(id string) (*PacketConfig, error) - Delete(container *PacketConfig) error -} - -func newPacketConfigClient(rancherClient *RancherClient) *PacketConfigClient { - return &PacketConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *PacketConfigClient) Create(container *PacketConfig) (*PacketConfig, error) { - resp := &PacketConfig{} - err := c.rancherClient.doCreate(PACKET_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *PacketConfigClient) Update(existing *PacketConfig, updates interface{}) (*PacketConfig, error) { - resp := &PacketConfig{} - err := c.rancherClient.doUpdate(PACKET_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PacketConfigClient) List(opts *ListOpts) (*PacketConfigCollection, error) { - resp := &PacketConfigCollection{} - err := c.rancherClient.doList(PACKET_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PacketConfigCollection) Next() (*PacketConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PacketConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PacketConfigClient) ById(id string) (*PacketConfig, error) { - resp := &PacketConfig{} - err := c.rancherClient.doById(PACKET_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PacketConfigClient) Delete(container *PacketConfig) error { - return c.rancherClient.doResourceDelete(PACKET_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_password.go b/vendor/github.com/rancher/go-rancher/v2/generated_password.go deleted file mode 100644 index 5fb0d35..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_password.go +++ /dev/null @@ -1,184 +0,0 @@ -package client - -const ( - PASSWORD_TYPE = "password" -) - -type Password struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicValue string `json:"publicValue,omitempty" yaml:"public_value,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SecretValue string `json:"secretValue,omitempty" yaml:"secret_value,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type PasswordCollection struct { - Collection - Data []Password `json:"data,omitempty"` - client *PasswordClient -} - -type PasswordClient struct { - rancherClient *RancherClient -} - -type PasswordOperations interface { - List(opts *ListOpts) (*PasswordCollection, error) - Create(opts *Password) (*Password, error) - Update(existing *Password, updates interface{}) (*Password, error) - ById(id string) (*Password, error) - Delete(container *Password) error - - ActionActivate(*Password) (*Credential, error) - - ActionChangesecret(*Password, *ChangeSecretInput) (*ChangeSecretInput, error) - - ActionCreate(*Password) (*Credential, error) - - ActionDeactivate(*Password) (*Credential, error) - - ActionPurge(*Password) (*Credential, error) - - ActionRemove(*Password) (*Credential, error) - - ActionUpdate(*Password) (*Credential, error) -} - -func newPasswordClient(rancherClient *RancherClient) *PasswordClient { - return &PasswordClient{ - rancherClient: rancherClient, - } -} - -func (c *PasswordClient) Create(container *Password) (*Password, error) { - resp := &Password{} - err := c.rancherClient.doCreate(PASSWORD_TYPE, container, resp) - return resp, err -} - -func (c *PasswordClient) Update(existing *Password, updates interface{}) (*Password, error) { - resp := &Password{} - err := c.rancherClient.doUpdate(PASSWORD_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PasswordClient) List(opts *ListOpts) (*PasswordCollection, error) { - resp := &PasswordCollection{} - err := c.rancherClient.doList(PASSWORD_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PasswordCollection) Next() (*PasswordCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PasswordCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PasswordClient) ById(id string) (*Password, error) { - resp := &Password{} - err := c.rancherClient.doById(PASSWORD_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PasswordClient) Delete(container *Password) error { - return c.rancherClient.doResourceDelete(PASSWORD_TYPE, &container.Resource) -} - -func (c *PasswordClient) ActionActivate(resource *Password) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PasswordClient) ActionChangesecret(resource *Password, input *ChangeSecretInput) (*ChangeSecretInput, error) { - - resp := &ChangeSecretInput{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "changesecret", &resource.Resource, input, resp) - - return resp, err -} - -func (c *PasswordClient) ActionCreate(resource *Password) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PasswordClient) ActionDeactivate(resource *Password) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PasswordClient) ActionPurge(resource *Password) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PasswordClient) ActionRemove(resource *Password) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PasswordClient) ActionUpdate(resource *Password) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go b/vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go deleted file mode 100644 index 30039c4..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go +++ /dev/null @@ -1,162 +0,0 @@ -package client - -const ( - PHYSICAL_HOST_TYPE = "physicalHost" -) - -type PhysicalHost struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type PhysicalHostCollection struct { - Collection - Data []PhysicalHost `json:"data,omitempty"` - client *PhysicalHostClient -} - -type PhysicalHostClient struct { - rancherClient *RancherClient -} - -type PhysicalHostOperations interface { - List(opts *ListOpts) (*PhysicalHostCollection, error) - Create(opts *PhysicalHost) (*PhysicalHost, error) - Update(existing *PhysicalHost, updates interface{}) (*PhysicalHost, error) - ById(id string) (*PhysicalHost, error) - Delete(container *PhysicalHost) error - - ActionBootstrap(*PhysicalHost) (*PhysicalHost, error) - - ActionCreate(*PhysicalHost) (*PhysicalHost, error) - - ActionError(*PhysicalHost) (*PhysicalHost, error) - - ActionRemove(*PhysicalHost) (*PhysicalHost, error) - - ActionUpdate(*PhysicalHost) (*PhysicalHost, error) -} - -func newPhysicalHostClient(rancherClient *RancherClient) *PhysicalHostClient { - return &PhysicalHostClient{ - rancherClient: rancherClient, - } -} - -func (c *PhysicalHostClient) Create(container *PhysicalHost) (*PhysicalHost, error) { - resp := &PhysicalHost{} - err := c.rancherClient.doCreate(PHYSICAL_HOST_TYPE, container, resp) - return resp, err -} - -func (c *PhysicalHostClient) Update(existing *PhysicalHost, updates interface{}) (*PhysicalHost, error) { - resp := &PhysicalHost{} - err := c.rancherClient.doUpdate(PHYSICAL_HOST_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PhysicalHostClient) List(opts *ListOpts) (*PhysicalHostCollection, error) { - resp := &PhysicalHostCollection{} - err := c.rancherClient.doList(PHYSICAL_HOST_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PhysicalHostCollection) Next() (*PhysicalHostCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PhysicalHostCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PhysicalHostClient) ById(id string) (*PhysicalHost, error) { - resp := &PhysicalHost{} - err := c.rancherClient.doById(PHYSICAL_HOST_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PhysicalHostClient) Delete(container *PhysicalHost) error { - return c.rancherClient.doResourceDelete(PHYSICAL_HOST_TYPE, &container.Resource) -} - -func (c *PhysicalHostClient) ActionBootstrap(resource *PhysicalHost) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "bootstrap", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PhysicalHostClient) ActionCreate(resource *PhysicalHost) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PhysicalHostClient) ActionError(resource *PhysicalHost) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PhysicalHostClient) ActionRemove(resource *PhysicalHost) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PhysicalHostClient) ActionUpdate(resource *PhysicalHost) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_port.go b/vendor/github.com/rancher/go-rancher/v2/generated_port.go deleted file mode 100644 index 1d7a1a9..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_port.go +++ /dev/null @@ -1,183 +0,0 @@ -package client - -const ( - PORT_TYPE = "port" -) - -type Port struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - BindAddress string `json:"bindAddress,omitempty" yaml:"bind_address,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PrivateIpAddressId string `json:"privateIpAddressId,omitempty" yaml:"private_ip_address_id,omitempty"` - - PrivatePort int64 `json:"privatePort,omitempty" yaml:"private_port,omitempty"` - - Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` - - PublicIpAddressId string `json:"publicIpAddressId,omitempty" yaml:"public_ip_address_id,omitempty"` - - PublicPort int64 `json:"publicPort,omitempty" yaml:"public_port,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type PortCollection struct { - Collection - Data []Port `json:"data,omitempty"` - client *PortClient -} - -type PortClient struct { - rancherClient *RancherClient -} - -type PortOperations interface { - List(opts *ListOpts) (*PortCollection, error) - Create(opts *Port) (*Port, error) - Update(existing *Port, updates interface{}) (*Port, error) - ById(id string) (*Port, error) - Delete(container *Port) error - - ActionActivate(*Port) (*Port, error) - - ActionCreate(*Port) (*Port, error) - - ActionDeactivate(*Port) (*Port, error) - - ActionPurge(*Port) (*Port, error) - - ActionRemove(*Port) (*Port, error) - - ActionUpdate(*Port) (*Port, error) -} - -func newPortClient(rancherClient *RancherClient) *PortClient { - return &PortClient{ - rancherClient: rancherClient, - } -} - -func (c *PortClient) Create(container *Port) (*Port, error) { - resp := &Port{} - err := c.rancherClient.doCreate(PORT_TYPE, container, resp) - return resp, err -} - -func (c *PortClient) Update(existing *Port, updates interface{}) (*Port, error) { - resp := &Port{} - err := c.rancherClient.doUpdate(PORT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PortClient) List(opts *ListOpts) (*PortCollection, error) { - resp := &PortCollection{} - err := c.rancherClient.doList(PORT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PortCollection) Next() (*PortCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PortCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PortClient) ById(id string) (*Port, error) { - resp := &Port{} - err := c.rancherClient.doById(PORT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PortClient) Delete(container *Port) error { - return c.rancherClient.doResourceDelete(PORT_TYPE, &container.Resource) -} - -func (c *PortClient) ActionActivate(resource *Port) (*Port, error) { - - resp := &Port{} - - err := c.rancherClient.doAction(PORT_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PortClient) ActionCreate(resource *Port) (*Port, error) { - - resp := &Port{} - - err := c.rancherClient.doAction(PORT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PortClient) ActionDeactivate(resource *Port) (*Port, error) { - - resp := &Port{} - - err := c.rancherClient.doAction(PORT_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PortClient) ActionPurge(resource *Port) (*Port, error) { - - resp := &Port{} - - err := c.rancherClient.doAction(PORT_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PortClient) ActionRemove(resource *Port) (*Port, error) { - - resp := &Port{} - - err := c.rancherClient.doAction(PORT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PortClient) ActionUpdate(resource *Port) (*Port, error) { - - resp := &Port{} - - err := c.rancherClient.doAction(PORT_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go b/vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go deleted file mode 100644 index 0e03656..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go +++ /dev/null @@ -1,95 +0,0 @@ -package client - -const ( - PORT_RULE_TYPE = "portRule" -) - -type PortRule struct { - Resource - - BackendName string `json:"backendName,omitempty" yaml:"backend_name,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - Path string `json:"path,omitempty" yaml:"path,omitempty"` - - Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` - - Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` - - Selector string `json:"selector,omitempty" yaml:"selector,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - SourcePort int64 `json:"sourcePort,omitempty" yaml:"source_port,omitempty"` - - TargetPort int64 `json:"targetPort,omitempty" yaml:"target_port,omitempty"` -} - -type PortRuleCollection struct { - Collection - Data []PortRule `json:"data,omitempty"` - client *PortRuleClient -} - -type PortRuleClient struct { - rancherClient *RancherClient -} - -type PortRuleOperations interface { - List(opts *ListOpts) (*PortRuleCollection, error) - Create(opts *PortRule) (*PortRule, error) - Update(existing *PortRule, updates interface{}) (*PortRule, error) - ById(id string) (*PortRule, error) - Delete(container *PortRule) error -} - -func newPortRuleClient(rancherClient *RancherClient) *PortRuleClient { - return &PortRuleClient{ - rancherClient: rancherClient, - } -} - -func (c *PortRuleClient) Create(container *PortRule) (*PortRule, error) { - resp := &PortRule{} - err := c.rancherClient.doCreate(PORT_RULE_TYPE, container, resp) - return resp, err -} - -func (c *PortRuleClient) Update(existing *PortRule, updates interface{}) (*PortRule, error) { - resp := &PortRule{} - err := c.rancherClient.doUpdate(PORT_RULE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PortRuleClient) List(opts *ListOpts) (*PortRuleCollection, error) { - resp := &PortRuleCollection{} - err := c.rancherClient.doList(PORT_RULE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PortRuleCollection) Next() (*PortRuleCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PortRuleCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PortRuleClient) ById(id string) (*PortRule, error) { - resp := &PortRule{} - err := c.rancherClient.doById(PORT_RULE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PortRuleClient) Delete(container *PortRule) error { - return c.rancherClient.doResourceDelete(PORT_RULE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go deleted file mode 100644 index 9da63d8..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go +++ /dev/null @@ -1,91 +0,0 @@ -package client - -const ( - PROCESS_DEFINITION_TYPE = "processDefinition" -) - -type ProcessDefinition struct { - Resource - - ExtensionBased bool `json:"extensionBased,omitempty" yaml:"extension_based,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PostProcessListeners interface{} `json:"postProcessListeners,omitempty" yaml:"post_process_listeners,omitempty"` - - PreProcessListeners interface{} `json:"preProcessListeners,omitempty" yaml:"pre_process_listeners,omitempty"` - - ProcessHandlers interface{} `json:"processHandlers,omitempty" yaml:"process_handlers,omitempty"` - - ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` - - StateTransitions []StateTransition `json:"stateTransitions,omitempty" yaml:"state_transitions,omitempty"` -} - -type ProcessDefinitionCollection struct { - Collection - Data []ProcessDefinition `json:"data,omitempty"` - client *ProcessDefinitionClient -} - -type ProcessDefinitionClient struct { - rancherClient *RancherClient -} - -type ProcessDefinitionOperations interface { - List(opts *ListOpts) (*ProcessDefinitionCollection, error) - Create(opts *ProcessDefinition) (*ProcessDefinition, error) - Update(existing *ProcessDefinition, updates interface{}) (*ProcessDefinition, error) - ById(id string) (*ProcessDefinition, error) - Delete(container *ProcessDefinition) error -} - -func newProcessDefinitionClient(rancherClient *RancherClient) *ProcessDefinitionClient { - return &ProcessDefinitionClient{ - rancherClient: rancherClient, - } -} - -func (c *ProcessDefinitionClient) Create(container *ProcessDefinition) (*ProcessDefinition, error) { - resp := &ProcessDefinition{} - err := c.rancherClient.doCreate(PROCESS_DEFINITION_TYPE, container, resp) - return resp, err -} - -func (c *ProcessDefinitionClient) Update(existing *ProcessDefinition, updates interface{}) (*ProcessDefinition, error) { - resp := &ProcessDefinition{} - err := c.rancherClient.doUpdate(PROCESS_DEFINITION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProcessDefinitionClient) List(opts *ListOpts) (*ProcessDefinitionCollection, error) { - resp := &ProcessDefinitionCollection{} - err := c.rancherClient.doList(PROCESS_DEFINITION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProcessDefinitionCollection) Next() (*ProcessDefinitionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProcessDefinitionCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProcessDefinitionClient) ById(id string) (*ProcessDefinition, error) { - resp := &ProcessDefinition{} - err := c.rancherClient.doById(PROCESS_DEFINITION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProcessDefinitionClient) Delete(container *ProcessDefinition) error { - return c.rancherClient.doResourceDelete(PROCESS_DEFINITION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go deleted file mode 100644 index 7356dce..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -const ( - PROCESS_EXECUTION_TYPE = "processExecution" -) - -type ProcessExecution struct { - Resource - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Log map[string]interface{} `json:"log,omitempty" yaml:"log,omitempty"` - - ProcessInstanceId string `json:"processInstanceId,omitempty" yaml:"process_instance_id,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ProcessExecutionCollection struct { - Collection - Data []ProcessExecution `json:"data,omitempty"` - client *ProcessExecutionClient -} - -type ProcessExecutionClient struct { - rancherClient *RancherClient -} - -type ProcessExecutionOperations interface { - List(opts *ListOpts) (*ProcessExecutionCollection, error) - Create(opts *ProcessExecution) (*ProcessExecution, error) - Update(existing *ProcessExecution, updates interface{}) (*ProcessExecution, error) - ById(id string) (*ProcessExecution, error) - Delete(container *ProcessExecution) error -} - -func newProcessExecutionClient(rancherClient *RancherClient) *ProcessExecutionClient { - return &ProcessExecutionClient{ - rancherClient: rancherClient, - } -} - -func (c *ProcessExecutionClient) Create(container *ProcessExecution) (*ProcessExecution, error) { - resp := &ProcessExecution{} - err := c.rancherClient.doCreate(PROCESS_EXECUTION_TYPE, container, resp) - return resp, err -} - -func (c *ProcessExecutionClient) Update(existing *ProcessExecution, updates interface{}) (*ProcessExecution, error) { - resp := &ProcessExecution{} - err := c.rancherClient.doUpdate(PROCESS_EXECUTION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProcessExecutionClient) List(opts *ListOpts) (*ProcessExecutionCollection, error) { - resp := &ProcessExecutionCollection{} - err := c.rancherClient.doList(PROCESS_EXECUTION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProcessExecutionCollection) Next() (*ProcessExecutionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProcessExecutionCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProcessExecutionClient) ById(id string) (*ProcessExecution, error) { - resp := &ProcessExecution{} - err := c.rancherClient.doById(PROCESS_EXECUTION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProcessExecutionClient) Delete(container *ProcessExecution) error { - return c.rancherClient.doResourceDelete(PROCESS_EXECUTION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go deleted file mode 100644 index deae1af..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go +++ /dev/null @@ -1,118 +0,0 @@ -package client - -const ( - PROCESS_INSTANCE_TYPE = "processInstance" -) - -type ProcessInstance struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - EndTime string `json:"endTime,omitempty" yaml:"end_time,omitempty"` - - ExecutionCount int64 `json:"executionCount,omitempty" yaml:"execution_count,omitempty"` - - ExitReason string `json:"exitReason,omitempty" yaml:"exit_reason,omitempty"` - - Phase string `json:"phase,omitempty" yaml:"phase,omitempty"` - - Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` - - ProcessName string `json:"processName,omitempty" yaml:"process_name,omitempty"` - - ResourceId string `json:"resourceId,omitempty" yaml:"resource_id,omitempty"` - - ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` - - Result string `json:"result,omitempty" yaml:"result,omitempty"` - - RunAfter string `json:"runAfter,omitempty" yaml:"run_after,omitempty"` - - RunningProcessServerId string `json:"runningProcessServerId,omitempty" yaml:"running_process_server_id,omitempty"` - - StartProcessServerId string `json:"startProcessServerId,omitempty" yaml:"start_process_server_id,omitempty"` - - StartTime string `json:"startTime,omitempty" yaml:"start_time,omitempty"` -} - -type ProcessInstanceCollection struct { - Collection - Data []ProcessInstance `json:"data,omitempty"` - client *ProcessInstanceClient -} - -type ProcessInstanceClient struct { - rancherClient *RancherClient -} - -type ProcessInstanceOperations interface { - List(opts *ListOpts) (*ProcessInstanceCollection, error) - Create(opts *ProcessInstance) (*ProcessInstance, error) - Update(existing *ProcessInstance, updates interface{}) (*ProcessInstance, error) - ById(id string) (*ProcessInstance, error) - Delete(container *ProcessInstance) error - - ActionReplay(*ProcessInstance) (*ProcessInstance, error) -} - -func newProcessInstanceClient(rancherClient *RancherClient) *ProcessInstanceClient { - return &ProcessInstanceClient{ - rancherClient: rancherClient, - } -} - -func (c *ProcessInstanceClient) Create(container *ProcessInstance) (*ProcessInstance, error) { - resp := &ProcessInstance{} - err := c.rancherClient.doCreate(PROCESS_INSTANCE_TYPE, container, resp) - return resp, err -} - -func (c *ProcessInstanceClient) Update(existing *ProcessInstance, updates interface{}) (*ProcessInstance, error) { - resp := &ProcessInstance{} - err := c.rancherClient.doUpdate(PROCESS_INSTANCE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProcessInstanceClient) List(opts *ListOpts) (*ProcessInstanceCollection, error) { - resp := &ProcessInstanceCollection{} - err := c.rancherClient.doList(PROCESS_INSTANCE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProcessInstanceCollection) Next() (*ProcessInstanceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProcessInstanceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProcessInstanceClient) ById(id string) (*ProcessInstance, error) { - resp := &ProcessInstance{} - err := c.rancherClient.doById(PROCESS_INSTANCE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProcessInstanceClient) Delete(container *ProcessInstance) error { - return c.rancherClient.doResourceDelete(PROCESS_INSTANCE_TYPE, &container.Resource) -} - -func (c *ProcessInstanceClient) ActionReplay(resource *ProcessInstance) (*ProcessInstance, error) { - - resp := &ProcessInstance{} - - err := c.rancherClient.doAction(PROCESS_INSTANCE_TYPE, "replay", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_pool.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_pool.go deleted file mode 100644 index 1fbff0b..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_process_pool.go +++ /dev/null @@ -1,95 +0,0 @@ -package client - -const ( - PROCESS_POOL_TYPE = "processPool" -) - -type ProcessPool struct { - Resource - - ActiveTasks int64 `json:"activeTasks,omitempty" yaml:"active_tasks,omitempty"` - - CompletedTasks int64 `json:"completedTasks,omitempty" yaml:"completed_tasks,omitempty"` - - MaxPoolSize int64 `json:"maxPoolSize,omitempty" yaml:"max_pool_size,omitempty"` - - MinPoolSize int64 `json:"minPoolSize,omitempty" yaml:"min_pool_size,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PoolSize int64 `json:"poolSize,omitempty" yaml:"pool_size,omitempty"` - - QueueRemainingCapacity int64 `json:"queueRemainingCapacity,omitempty" yaml:"queue_remaining_capacity,omitempty"` - - QueueSize int64 `json:"queueSize,omitempty" yaml:"queue_size,omitempty"` - - RejectedTasks int64 `json:"rejectedTasks,omitempty" yaml:"rejected_tasks,omitempty"` -} - -type ProcessPoolCollection struct { - Collection - Data []ProcessPool `json:"data,omitempty"` - client *ProcessPoolClient -} - -type ProcessPoolClient struct { - rancherClient *RancherClient -} - -type ProcessPoolOperations interface { - List(opts *ListOpts) (*ProcessPoolCollection, error) - Create(opts *ProcessPool) (*ProcessPool, error) - Update(existing *ProcessPool, updates interface{}) (*ProcessPool, error) - ById(id string) (*ProcessPool, error) - Delete(container *ProcessPool) error -} - -func newProcessPoolClient(rancherClient *RancherClient) *ProcessPoolClient { - return &ProcessPoolClient{ - rancherClient: rancherClient, - } -} - -func (c *ProcessPoolClient) Create(container *ProcessPool) (*ProcessPool, error) { - resp := &ProcessPool{} - err := c.rancherClient.doCreate(PROCESS_POOL_TYPE, container, resp) - return resp, err -} - -func (c *ProcessPoolClient) Update(existing *ProcessPool, updates interface{}) (*ProcessPool, error) { - resp := &ProcessPool{} - err := c.rancherClient.doUpdate(PROCESS_POOL_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProcessPoolClient) List(opts *ListOpts) (*ProcessPoolCollection, error) { - resp := &ProcessPoolCollection{} - err := c.rancherClient.doList(PROCESS_POOL_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProcessPoolCollection) Next() (*ProcessPoolCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProcessPoolCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProcessPoolClient) ById(id string) (*ProcessPool, error) { - resp := &ProcessPool{} - err := c.rancherClient.doById(PROCESS_POOL_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProcessPoolClient) Delete(container *ProcessPool) error { - return c.rancherClient.doResourceDelete(PROCESS_POOL_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_summary.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_summary.go deleted file mode 100644 index aed14d7..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_process_summary.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -const ( - PROCESS_SUMMARY_TYPE = "processSummary" -) - -type ProcessSummary struct { - Resource - - Delay int64 `json:"delay,omitempty" yaml:"delay,omitempty"` - - ProcessName string `json:"processName,omitempty" yaml:"process_name,omitempty"` - - Ready int64 `json:"ready,omitempty" yaml:"ready,omitempty"` - - Running int64 `json:"running,omitempty" yaml:"running,omitempty"` -} - -type ProcessSummaryCollection struct { - Collection - Data []ProcessSummary `json:"data,omitempty"` - client *ProcessSummaryClient -} - -type ProcessSummaryClient struct { - rancherClient *RancherClient -} - -type ProcessSummaryOperations interface { - List(opts *ListOpts) (*ProcessSummaryCollection, error) - Create(opts *ProcessSummary) (*ProcessSummary, error) - Update(existing *ProcessSummary, updates interface{}) (*ProcessSummary, error) - ById(id string) (*ProcessSummary, error) - Delete(container *ProcessSummary) error -} - -func newProcessSummaryClient(rancherClient *RancherClient) *ProcessSummaryClient { - return &ProcessSummaryClient{ - rancherClient: rancherClient, - } -} - -func (c *ProcessSummaryClient) Create(container *ProcessSummary) (*ProcessSummary, error) { - resp := &ProcessSummary{} - err := c.rancherClient.doCreate(PROCESS_SUMMARY_TYPE, container, resp) - return resp, err -} - -func (c *ProcessSummaryClient) Update(existing *ProcessSummary, updates interface{}) (*ProcessSummary, error) { - resp := &ProcessSummary{} - err := c.rancherClient.doUpdate(PROCESS_SUMMARY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProcessSummaryClient) List(opts *ListOpts) (*ProcessSummaryCollection, error) { - resp := &ProcessSummaryCollection{} - err := c.rancherClient.doList(PROCESS_SUMMARY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProcessSummaryCollection) Next() (*ProcessSummaryCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProcessSummaryCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProcessSummaryClient) ById(id string) (*ProcessSummary, error) { - resp := &ProcessSummary{} - err := c.rancherClient.doById(PROCESS_SUMMARY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProcessSummaryClient) Delete(container *ProcessSummary) error { - return c.rancherClient.doResourceDelete(PROCESS_SUMMARY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_project.go b/vendor/github.com/rancher/go-rancher/v2/generated_project.go deleted file mode 100644 index 8abc198..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_project.go +++ /dev/null @@ -1,211 +0,0 @@ -package client - -const ( - PROJECT_TYPE = "project" -) - -type Project struct { - Resource - - AllowSystemRole bool `json:"allowSystemRole,omitempty" yaml:"allow_system_role,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DefaultNetworkId string `json:"defaultNetworkId,omitempty" yaml:"default_network_id,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - HostRemoveDelaySeconds int64 `json:"hostRemoveDelaySeconds,omitempty" yaml:"host_remove_delay_seconds,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Members []ProjectMember `json:"members,omitempty" yaml:"members,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Orchestration string `json:"orchestration,omitempty" yaml:"orchestration,omitempty"` - - ProjectLinks []string `json:"projectLinks,omitempty" yaml:"project_links,omitempty"` - - ProjectTemplateId string `json:"projectTemplateId,omitempty" yaml:"project_template_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServicesPortRange *ServicesPortRange `json:"servicesPortRange,omitempty" yaml:"services_port_range,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` - - VirtualMachine bool `json:"virtualMachine,omitempty" yaml:"virtual_machine,omitempty"` -} - -type ProjectCollection struct { - Collection - Data []Project `json:"data,omitempty"` - client *ProjectClient -} - -type ProjectClient struct { - rancherClient *RancherClient -} - -type ProjectOperations interface { - List(opts *ListOpts) (*ProjectCollection, error) - Create(opts *Project) (*Project, error) - Update(existing *Project, updates interface{}) (*Project, error) - ById(id string) (*Project, error) - Delete(container *Project) error - - ActionActivate(*Project) (*Account, error) - - ActionCreate(*Project) (*Account, error) - - ActionDeactivate(*Project) (*Account, error) - - ActionPurge(*Project) (*Account, error) - - ActionRemove(*Project) (*Account, error) - - ActionSetmembers(*Project, *SetProjectMembersInput) (*SetProjectMembersInput, error) - - ActionUpdate(*Project) (*Account, error) - - ActionUpgrade(*Project) (*Account, error) -} - -func newProjectClient(rancherClient *RancherClient) *ProjectClient { - return &ProjectClient{ - rancherClient: rancherClient, - } -} - -func (c *ProjectClient) Create(container *Project) (*Project, error) { - resp := &Project{} - err := c.rancherClient.doCreate(PROJECT_TYPE, container, resp) - return resp, err -} - -func (c *ProjectClient) Update(existing *Project, updates interface{}) (*Project, error) { - resp := &Project{} - err := c.rancherClient.doUpdate(PROJECT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectClient) List(opts *ListOpts) (*ProjectCollection, error) { - resp := &ProjectCollection{} - err := c.rancherClient.doList(PROJECT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProjectCollection) Next() (*ProjectCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectClient) ById(id string) (*Project, error) { - resp := &Project{} - err := c.rancherClient.doById(PROJECT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProjectClient) Delete(container *Project) error { - return c.rancherClient.doResourceDelete(PROJECT_TYPE, &container.Resource) -} - -func (c *ProjectClient) ActionActivate(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectClient) ActionCreate(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectClient) ActionDeactivate(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectClient) ActionPurge(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectClient) ActionRemove(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectClient) ActionSetmembers(resource *Project, input *SetProjectMembersInput) (*SetProjectMembersInput, error) { - - resp := &SetProjectMembersInput{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "setmembers", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ProjectClient) ActionUpdate(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectClient) ActionUpgrade(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "upgrade", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_project_member.go b/vendor/github.com/rancher/go-rancher/v2/generated_project_member.go deleted file mode 100644 index 569c5a2..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_project_member.go +++ /dev/null @@ -1,175 +0,0 @@ -package client - -const ( - PROJECT_MEMBER_TYPE = "projectMember" -) - -type ProjectMember struct { - Resource - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExternalIdType string `json:"externalIdType,omitempty" yaml:"external_id_type,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - ProjectId string `json:"projectId,omitempty" yaml:"project_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - Role string `json:"role,omitempty" yaml:"role,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ProjectMemberCollection struct { - Collection - Data []ProjectMember `json:"data,omitempty"` - client *ProjectMemberClient -} - -type ProjectMemberClient struct { - rancherClient *RancherClient -} - -type ProjectMemberOperations interface { - List(opts *ListOpts) (*ProjectMemberCollection, error) - Create(opts *ProjectMember) (*ProjectMember, error) - Update(existing *ProjectMember, updates interface{}) (*ProjectMember, error) - ById(id string) (*ProjectMember, error) - Delete(container *ProjectMember) error - - ActionActivate(*ProjectMember) (*ProjectMember, error) - - ActionCreate(*ProjectMember) (*ProjectMember, error) - - ActionDeactivate(*ProjectMember) (*ProjectMember, error) - - ActionPurge(*ProjectMember) (*ProjectMember, error) - - ActionRemove(*ProjectMember) (*ProjectMember, error) - - ActionUpdate(*ProjectMember) (*ProjectMember, error) -} - -func newProjectMemberClient(rancherClient *RancherClient) *ProjectMemberClient { - return &ProjectMemberClient{ - rancherClient: rancherClient, - } -} - -func (c *ProjectMemberClient) Create(container *ProjectMember) (*ProjectMember, error) { - resp := &ProjectMember{} - err := c.rancherClient.doCreate(PROJECT_MEMBER_TYPE, container, resp) - return resp, err -} - -func (c *ProjectMemberClient) Update(existing *ProjectMember, updates interface{}) (*ProjectMember, error) { - resp := &ProjectMember{} - err := c.rancherClient.doUpdate(PROJECT_MEMBER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectMemberClient) List(opts *ListOpts) (*ProjectMemberCollection, error) { - resp := &ProjectMemberCollection{} - err := c.rancherClient.doList(PROJECT_MEMBER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProjectMemberCollection) Next() (*ProjectMemberCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectMemberCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectMemberClient) ById(id string) (*ProjectMember, error) { - resp := &ProjectMember{} - err := c.rancherClient.doById(PROJECT_MEMBER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProjectMemberClient) Delete(container *ProjectMember) error { - return c.rancherClient.doResourceDelete(PROJECT_MEMBER_TYPE, &container.Resource) -} - -func (c *ProjectMemberClient) ActionActivate(resource *ProjectMember) (*ProjectMember, error) { - - resp := &ProjectMember{} - - err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectMemberClient) ActionCreate(resource *ProjectMember) (*ProjectMember, error) { - - resp := &ProjectMember{} - - err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectMemberClient) ActionDeactivate(resource *ProjectMember) (*ProjectMember, error) { - - resp := &ProjectMember{} - - err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectMemberClient) ActionPurge(resource *ProjectMember) (*ProjectMember, error) { - - resp := &ProjectMember{} - - err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectMemberClient) ActionRemove(resource *ProjectMember) (*ProjectMember, error) { - - resp := &ProjectMember{} - - err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectMemberClient) ActionUpdate(resource *ProjectMember) (*ProjectMember, error) { - - resp := &ProjectMember{} - - err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_project_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_project_template.go deleted file mode 100644 index 9c20883..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_project_template.go +++ /dev/null @@ -1,131 +0,0 @@ -package client - -const ( - PROJECT_TEMPLATE_TYPE = "projectTemplate" -) - -type ProjectTemplate struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - IsPublic bool `json:"isPublic,omitempty" yaml:"is_public,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - Stacks []CatalogTemplate `json:"stacks,omitempty" yaml:"stacks,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ProjectTemplateCollection struct { - Collection - Data []ProjectTemplate `json:"data,omitempty"` - client *ProjectTemplateClient -} - -type ProjectTemplateClient struct { - rancherClient *RancherClient -} - -type ProjectTemplateOperations interface { - List(opts *ListOpts) (*ProjectTemplateCollection, error) - Create(opts *ProjectTemplate) (*ProjectTemplate, error) - Update(existing *ProjectTemplate, updates interface{}) (*ProjectTemplate, error) - ById(id string) (*ProjectTemplate, error) - Delete(container *ProjectTemplate) error - - ActionCreate(*ProjectTemplate) (*ProjectTemplate, error) - - ActionRemove(*ProjectTemplate) (*ProjectTemplate, error) -} - -func newProjectTemplateClient(rancherClient *RancherClient) *ProjectTemplateClient { - return &ProjectTemplateClient{ - rancherClient: rancherClient, - } -} - -func (c *ProjectTemplateClient) Create(container *ProjectTemplate) (*ProjectTemplate, error) { - resp := &ProjectTemplate{} - err := c.rancherClient.doCreate(PROJECT_TEMPLATE_TYPE, container, resp) - return resp, err -} - -func (c *ProjectTemplateClient) Update(existing *ProjectTemplate, updates interface{}) (*ProjectTemplate, error) { - resp := &ProjectTemplate{} - err := c.rancherClient.doUpdate(PROJECT_TEMPLATE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectTemplateClient) List(opts *ListOpts) (*ProjectTemplateCollection, error) { - resp := &ProjectTemplateCollection{} - err := c.rancherClient.doList(PROJECT_TEMPLATE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProjectTemplateCollection) Next() (*ProjectTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectTemplateCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectTemplateClient) ById(id string) (*ProjectTemplate, error) { - resp := &ProjectTemplate{} - err := c.rancherClient.doById(PROJECT_TEMPLATE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProjectTemplateClient) Delete(container *ProjectTemplate) error { - return c.rancherClient.doResourceDelete(PROJECT_TEMPLATE_TYPE, &container.Resource) -} - -func (c *ProjectTemplateClient) ActionCreate(resource *ProjectTemplate) (*ProjectTemplate, error) { - - resp := &ProjectTemplate{} - - err := c.rancherClient.doAction(PROJECT_TEMPLATE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectTemplateClient) ActionRemove(resource *ProjectTemplate) (*ProjectTemplate, error) { - - resp := &ProjectTemplate{} - - err := c.rancherClient.doAction(PROJECT_TEMPLATE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go b/vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go deleted file mode 100644 index 14898e4..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - PUBLIC_ENDPOINT_TYPE = "publicEndpoint" -) - -type PublicEndpoint struct { - Resource - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - IpAddress string `json:"ipAddress,omitempty" yaml:"ip_address,omitempty"` - - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` -} - -type PublicEndpointCollection struct { - Collection - Data []PublicEndpoint `json:"data,omitempty"` - client *PublicEndpointClient -} - -type PublicEndpointClient struct { - rancherClient *RancherClient -} - -type PublicEndpointOperations interface { - List(opts *ListOpts) (*PublicEndpointCollection, error) - Create(opts *PublicEndpoint) (*PublicEndpoint, error) - Update(existing *PublicEndpoint, updates interface{}) (*PublicEndpoint, error) - ById(id string) (*PublicEndpoint, error) - Delete(container *PublicEndpoint) error -} - -func newPublicEndpointClient(rancherClient *RancherClient) *PublicEndpointClient { - return &PublicEndpointClient{ - rancherClient: rancherClient, - } -} - -func (c *PublicEndpointClient) Create(container *PublicEndpoint) (*PublicEndpoint, error) { - resp := &PublicEndpoint{} - err := c.rancherClient.doCreate(PUBLIC_ENDPOINT_TYPE, container, resp) - return resp, err -} - -func (c *PublicEndpointClient) Update(existing *PublicEndpoint, updates interface{}) (*PublicEndpoint, error) { - resp := &PublicEndpoint{} - err := c.rancherClient.doUpdate(PUBLIC_ENDPOINT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PublicEndpointClient) List(opts *ListOpts) (*PublicEndpointCollection, error) { - resp := &PublicEndpointCollection{} - err := c.rancherClient.doList(PUBLIC_ENDPOINT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PublicEndpointCollection) Next() (*PublicEndpointCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PublicEndpointCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PublicEndpointClient) ById(id string) (*PublicEndpoint, error) { - resp := &PublicEndpoint{} - err := c.rancherClient.doById(PUBLIC_ENDPOINT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PublicEndpointClient) Delete(container *PublicEndpoint) error { - return c.rancherClient.doResourceDelete(PUBLIC_ENDPOINT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_publish.go b/vendor/github.com/rancher/go-rancher/v2/generated_publish.go deleted file mode 100644 index af7f7cd..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_publish.go +++ /dev/null @@ -1,99 +0,0 @@ -package client - -const ( - PUBLISH_TYPE = "publish" -) - -type Publish struct { - Resource - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PreviousIds []string `json:"previousIds,omitempty" yaml:"previous_ids,omitempty"` - - Publisher string `json:"publisher,omitempty" yaml:"publisher,omitempty"` - - ResourceId string `json:"resourceId,omitempty" yaml:"resource_id,omitempty"` - - ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` - - Time int64 `json:"time,omitempty" yaml:"time,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningInternalMessage string `json:"transitioningInternalMessage,omitempty" yaml:"transitioning_internal_message,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` -} - -type PublishCollection struct { - Collection - Data []Publish `json:"data,omitempty"` - client *PublishClient -} - -type PublishClient struct { - rancherClient *RancherClient -} - -type PublishOperations interface { - List(opts *ListOpts) (*PublishCollection, error) - Create(opts *Publish) (*Publish, error) - Update(existing *Publish, updates interface{}) (*Publish, error) - ById(id string) (*Publish, error) - Delete(container *Publish) error -} - -func newPublishClient(rancherClient *RancherClient) *PublishClient { - return &PublishClient{ - rancherClient: rancherClient, - } -} - -func (c *PublishClient) Create(container *Publish) (*Publish, error) { - resp := &Publish{} - err := c.rancherClient.doCreate(PUBLISH_TYPE, container, resp) - return resp, err -} - -func (c *PublishClient) Update(existing *Publish, updates interface{}) (*Publish, error) { - resp := &Publish{} - err := c.rancherClient.doUpdate(PUBLISH_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PublishClient) List(opts *ListOpts) (*PublishCollection, error) { - resp := &PublishCollection{} - err := c.rancherClient.doList(PUBLISH_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PublishCollection) Next() (*PublishCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PublishCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PublishClient) ById(id string) (*Publish, error) { - resp := &Publish{} - err := c.rancherClient.doById(PUBLISH_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PublishClient) Delete(container *Publish) error { - return c.rancherClient.doResourceDelete(PUBLISH_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go b/vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go deleted file mode 100644 index 3958091..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go +++ /dev/null @@ -1,133 +0,0 @@ -package client - -const ( - PULL_TASK_TYPE = "pullTask" -) - -type PullTask struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Image string `json:"image,omitempty" yaml:"image,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Status map[string]interface{} `json:"status,omitempty" yaml:"status,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type PullTaskCollection struct { - Collection - Data []PullTask `json:"data,omitempty"` - client *PullTaskClient -} - -type PullTaskClient struct { - rancherClient *RancherClient -} - -type PullTaskOperations interface { - List(opts *ListOpts) (*PullTaskCollection, error) - Create(opts *PullTask) (*PullTask, error) - Update(existing *PullTask, updates interface{}) (*PullTask, error) - ById(id string) (*PullTask, error) - Delete(container *PullTask) error - - ActionCreate(*PullTask) (*GenericObject, error) - - ActionRemove(*PullTask) (*GenericObject, error) -} - -func newPullTaskClient(rancherClient *RancherClient) *PullTaskClient { - return &PullTaskClient{ - rancherClient: rancherClient, - } -} - -func (c *PullTaskClient) Create(container *PullTask) (*PullTask, error) { - resp := &PullTask{} - err := c.rancherClient.doCreate(PULL_TASK_TYPE, container, resp) - return resp, err -} - -func (c *PullTaskClient) Update(existing *PullTask, updates interface{}) (*PullTask, error) { - resp := &PullTask{} - err := c.rancherClient.doUpdate(PULL_TASK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PullTaskClient) List(opts *ListOpts) (*PullTaskCollection, error) { - resp := &PullTaskCollection{} - err := c.rancherClient.doList(PULL_TASK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PullTaskCollection) Next() (*PullTaskCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PullTaskCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PullTaskClient) ById(id string) (*PullTask, error) { - resp := &PullTask{} - err := c.rancherClient.doById(PULL_TASK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PullTaskClient) Delete(container *PullTask) error { - return c.rancherClient.doResourceDelete(PULL_TASK_TYPE, &container.Resource) -} - -func (c *PullTaskClient) ActionCreate(resource *PullTask) (*GenericObject, error) { - - resp := &GenericObject{} - - err := c.rancherClient.doAction(PULL_TASK_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PullTaskClient) ActionRemove(resource *PullTask) (*GenericObject, error) { - - resp := &GenericObject{} - - err := c.rancherClient.doAction(PULL_TASK_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go deleted file mode 100644 index ad1e718..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE = "recreateOnQuorumStrategyConfig" -) - -type RecreateOnQuorumStrategyConfig struct { - Resource - - Quorum int64 `json:"quorum,omitempty" yaml:"quorum,omitempty"` -} - -type RecreateOnQuorumStrategyConfigCollection struct { - Collection - Data []RecreateOnQuorumStrategyConfig `json:"data,omitempty"` - client *RecreateOnQuorumStrategyConfigClient -} - -type RecreateOnQuorumStrategyConfigClient struct { - rancherClient *RancherClient -} - -type RecreateOnQuorumStrategyConfigOperations interface { - List(opts *ListOpts) (*RecreateOnQuorumStrategyConfigCollection, error) - Create(opts *RecreateOnQuorumStrategyConfig) (*RecreateOnQuorumStrategyConfig, error) - Update(existing *RecreateOnQuorumStrategyConfig, updates interface{}) (*RecreateOnQuorumStrategyConfig, error) - ById(id string) (*RecreateOnQuorumStrategyConfig, error) - Delete(container *RecreateOnQuorumStrategyConfig) error -} - -func newRecreateOnQuorumStrategyConfigClient(rancherClient *RancherClient) *RecreateOnQuorumStrategyConfigClient { - return &RecreateOnQuorumStrategyConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *RecreateOnQuorumStrategyConfigClient) Create(container *RecreateOnQuorumStrategyConfig) (*RecreateOnQuorumStrategyConfig, error) { - resp := &RecreateOnQuorumStrategyConfig{} - err := c.rancherClient.doCreate(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *RecreateOnQuorumStrategyConfigClient) Update(existing *RecreateOnQuorumStrategyConfig, updates interface{}) (*RecreateOnQuorumStrategyConfig, error) { - resp := &RecreateOnQuorumStrategyConfig{} - err := c.rancherClient.doUpdate(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RecreateOnQuorumStrategyConfigClient) List(opts *ListOpts) (*RecreateOnQuorumStrategyConfigCollection, error) { - resp := &RecreateOnQuorumStrategyConfigCollection{} - err := c.rancherClient.doList(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RecreateOnQuorumStrategyConfigCollection) Next() (*RecreateOnQuorumStrategyConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RecreateOnQuorumStrategyConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RecreateOnQuorumStrategyConfigClient) ById(id string) (*RecreateOnQuorumStrategyConfig, error) { - resp := &RecreateOnQuorumStrategyConfig{} - err := c.rancherClient.doById(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RecreateOnQuorumStrategyConfigClient) Delete(container *RecreateOnQuorumStrategyConfig) error { - return c.rancherClient.doResourceDelete(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_register.go b/vendor/github.com/rancher/go-rancher/v2/generated_register.go deleted file mode 100644 index abbdd80..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_register.go +++ /dev/null @@ -1,144 +0,0 @@ -package client - -const ( - REGISTER_TYPE = "register" -) - -type Register struct { - Resource - - AccessKey string `json:"accessKey,omitempty" yaml:"access_key,omitempty"` - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Key string `json:"key,omitempty" yaml:"key,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ResourceData map[string]interface{} `json:"resourceData,omitempty" yaml:"resource_data,omitempty"` - - SecretKey string `json:"secretKey,omitempty" yaml:"secret_key,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type RegisterCollection struct { - Collection - Data []Register `json:"data,omitempty"` - client *RegisterClient -} - -type RegisterClient struct { - rancherClient *RancherClient -} - -type RegisterOperations interface { - List(opts *ListOpts) (*RegisterCollection, error) - Create(opts *Register) (*Register, error) - Update(existing *Register, updates interface{}) (*Register, error) - ById(id string) (*Register, error) - Delete(container *Register) error - - ActionCreate(*Register) (*GenericObject, error) - - ActionRemove(*Register) (*GenericObject, error) - - ActionStop(*Register, *InstanceStop) (*Instance, error) -} - -func newRegisterClient(rancherClient *RancherClient) *RegisterClient { - return &RegisterClient{ - rancherClient: rancherClient, - } -} - -func (c *RegisterClient) Create(container *Register) (*Register, error) { - resp := &Register{} - err := c.rancherClient.doCreate(REGISTER_TYPE, container, resp) - return resp, err -} - -func (c *RegisterClient) Update(existing *Register, updates interface{}) (*Register, error) { - resp := &Register{} - err := c.rancherClient.doUpdate(REGISTER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RegisterClient) List(opts *ListOpts) (*RegisterCollection, error) { - resp := &RegisterCollection{} - err := c.rancherClient.doList(REGISTER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RegisterCollection) Next() (*RegisterCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RegisterCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RegisterClient) ById(id string) (*Register, error) { - resp := &Register{} - err := c.rancherClient.doById(REGISTER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RegisterClient) Delete(container *Register) error { - return c.rancherClient.doResourceDelete(REGISTER_TYPE, &container.Resource) -} - -func (c *RegisterClient) ActionCreate(resource *Register) (*GenericObject, error) { - - resp := &GenericObject{} - - err := c.rancherClient.doAction(REGISTER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegisterClient) ActionRemove(resource *Register) (*GenericObject, error) { - - resp := &GenericObject{} - - err := c.rancherClient.doAction(REGISTER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegisterClient) ActionStop(resource *Register, input *InstanceStop) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(REGISTER_TYPE, "stop", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go b/vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go deleted file mode 100644 index 1cbf178..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go +++ /dev/null @@ -1,177 +0,0 @@ -package client - -const ( - REGISTRATION_TOKEN_TYPE = "registrationToken" -) - -type RegistrationToken struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Command string `json:"command,omitempty" yaml:"command,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Image string `json:"image,omitempty" yaml:"image,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RegistrationUrl string `json:"registrationUrl,omitempty" yaml:"registration_url,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type RegistrationTokenCollection struct { - Collection - Data []RegistrationToken `json:"data,omitempty"` - client *RegistrationTokenClient -} - -type RegistrationTokenClient struct { - rancherClient *RancherClient -} - -type RegistrationTokenOperations interface { - List(opts *ListOpts) (*RegistrationTokenCollection, error) - Create(opts *RegistrationToken) (*RegistrationToken, error) - Update(existing *RegistrationToken, updates interface{}) (*RegistrationToken, error) - ById(id string) (*RegistrationToken, error) - Delete(container *RegistrationToken) error - - ActionActivate(*RegistrationToken) (*Credential, error) - - ActionCreate(*RegistrationToken) (*Credential, error) - - ActionDeactivate(*RegistrationToken) (*Credential, error) - - ActionPurge(*RegistrationToken) (*Credential, error) - - ActionRemove(*RegistrationToken) (*Credential, error) - - ActionUpdate(*RegistrationToken) (*Credential, error) -} - -func newRegistrationTokenClient(rancherClient *RancherClient) *RegistrationTokenClient { - return &RegistrationTokenClient{ - rancherClient: rancherClient, - } -} - -func (c *RegistrationTokenClient) Create(container *RegistrationToken) (*RegistrationToken, error) { - resp := &RegistrationToken{} - err := c.rancherClient.doCreate(REGISTRATION_TOKEN_TYPE, container, resp) - return resp, err -} - -func (c *RegistrationTokenClient) Update(existing *RegistrationToken, updates interface{}) (*RegistrationToken, error) { - resp := &RegistrationToken{} - err := c.rancherClient.doUpdate(REGISTRATION_TOKEN_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RegistrationTokenClient) List(opts *ListOpts) (*RegistrationTokenCollection, error) { - resp := &RegistrationTokenCollection{} - err := c.rancherClient.doList(REGISTRATION_TOKEN_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RegistrationTokenCollection) Next() (*RegistrationTokenCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RegistrationTokenCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RegistrationTokenClient) ById(id string) (*RegistrationToken, error) { - resp := &RegistrationToken{} - err := c.rancherClient.doById(REGISTRATION_TOKEN_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RegistrationTokenClient) Delete(container *RegistrationToken) error { - return c.rancherClient.doResourceDelete(REGISTRATION_TOKEN_TYPE, &container.Resource) -} - -func (c *RegistrationTokenClient) ActionActivate(resource *RegistrationToken) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistrationTokenClient) ActionCreate(resource *RegistrationToken) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistrationTokenClient) ActionDeactivate(resource *RegistrationToken) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistrationTokenClient) ActionPurge(resource *RegistrationToken) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistrationTokenClient) ActionRemove(resource *RegistrationToken) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistrationTokenClient) ActionUpdate(resource *RegistrationToken) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_registry.go b/vendor/github.com/rancher/go-rancher/v2/generated_registry.go deleted file mode 100644 index 2404789..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_registry.go +++ /dev/null @@ -1,181 +0,0 @@ -package client - -const ( - REGISTRY_TYPE = "registry" -) - -type Registry struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - BlockDevicePath string `json:"blockDevicePath,omitempty" yaml:"block_device_path,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DriverName string `json:"driverName,omitempty" yaml:"driver_name,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServerAddress string `json:"serverAddress,omitempty" yaml:"server_address,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeAccessMode string `json:"volumeAccessMode,omitempty" yaml:"volume_access_mode,omitempty"` - - VolumeCapabilities []string `json:"volumeCapabilities,omitempty" yaml:"volume_capabilities,omitempty"` -} - -type RegistryCollection struct { - Collection - Data []Registry `json:"data,omitempty"` - client *RegistryClient -} - -type RegistryClient struct { - rancherClient *RancherClient -} - -type RegistryOperations interface { - List(opts *ListOpts) (*RegistryCollection, error) - Create(opts *Registry) (*Registry, error) - Update(existing *Registry, updates interface{}) (*Registry, error) - ById(id string) (*Registry, error) - Delete(container *Registry) error - - ActionActivate(*Registry) (*StoragePool, error) - - ActionCreate(*Registry) (*StoragePool, error) - - ActionDeactivate(*Registry) (*StoragePool, error) - - ActionPurge(*Registry) (*StoragePool, error) - - ActionRemove(*Registry) (*StoragePool, error) - - ActionUpdate(*Registry) (*StoragePool, error) -} - -func newRegistryClient(rancherClient *RancherClient) *RegistryClient { - return &RegistryClient{ - rancherClient: rancherClient, - } -} - -func (c *RegistryClient) Create(container *Registry) (*Registry, error) { - resp := &Registry{} - err := c.rancherClient.doCreate(REGISTRY_TYPE, container, resp) - return resp, err -} - -func (c *RegistryClient) Update(existing *Registry, updates interface{}) (*Registry, error) { - resp := &Registry{} - err := c.rancherClient.doUpdate(REGISTRY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RegistryClient) List(opts *ListOpts) (*RegistryCollection, error) { - resp := &RegistryCollection{} - err := c.rancherClient.doList(REGISTRY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RegistryCollection) Next() (*RegistryCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RegistryCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RegistryClient) ById(id string) (*Registry, error) { - resp := &Registry{} - err := c.rancherClient.doById(REGISTRY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RegistryClient) Delete(container *Registry) error { - return c.rancherClient.doResourceDelete(REGISTRY_TYPE, &container.Resource) -} - -func (c *RegistryClient) ActionActivate(resource *Registry) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(REGISTRY_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryClient) ActionCreate(resource *Registry) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(REGISTRY_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryClient) ActionDeactivate(resource *Registry) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(REGISTRY_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryClient) ActionPurge(resource *Registry) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(REGISTRY_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryClient) ActionRemove(resource *Registry) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(REGISTRY_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryClient) ActionUpdate(resource *Registry) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(REGISTRY_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go b/vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go deleted file mode 100644 index 381fcd7..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go +++ /dev/null @@ -1,175 +0,0 @@ -package client - -const ( - REGISTRY_CREDENTIAL_TYPE = "registryCredential" -) - -type RegistryCredential struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicValue string `json:"publicValue,omitempty" yaml:"public_value,omitempty"` - - RegistryId string `json:"registryId,omitempty" yaml:"registry_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SecretValue string `json:"secretValue,omitempty" yaml:"secret_value,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type RegistryCredentialCollection struct { - Collection - Data []RegistryCredential `json:"data,omitempty"` - client *RegistryCredentialClient -} - -type RegistryCredentialClient struct { - rancherClient *RancherClient -} - -type RegistryCredentialOperations interface { - List(opts *ListOpts) (*RegistryCredentialCollection, error) - Create(opts *RegistryCredential) (*RegistryCredential, error) - Update(existing *RegistryCredential, updates interface{}) (*RegistryCredential, error) - ById(id string) (*RegistryCredential, error) - Delete(container *RegistryCredential) error - - ActionActivate(*RegistryCredential) (*Credential, error) - - ActionCreate(*RegistryCredential) (*Credential, error) - - ActionDeactivate(*RegistryCredential) (*Credential, error) - - ActionPurge(*RegistryCredential) (*Credential, error) - - ActionRemove(*RegistryCredential) (*Credential, error) - - ActionUpdate(*RegistryCredential) (*Credential, error) -} - -func newRegistryCredentialClient(rancherClient *RancherClient) *RegistryCredentialClient { - return &RegistryCredentialClient{ - rancherClient: rancherClient, - } -} - -func (c *RegistryCredentialClient) Create(container *RegistryCredential) (*RegistryCredential, error) { - resp := &RegistryCredential{} - err := c.rancherClient.doCreate(REGISTRY_CREDENTIAL_TYPE, container, resp) - return resp, err -} - -func (c *RegistryCredentialClient) Update(existing *RegistryCredential, updates interface{}) (*RegistryCredential, error) { - resp := &RegistryCredential{} - err := c.rancherClient.doUpdate(REGISTRY_CREDENTIAL_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RegistryCredentialClient) List(opts *ListOpts) (*RegistryCredentialCollection, error) { - resp := &RegistryCredentialCollection{} - err := c.rancherClient.doList(REGISTRY_CREDENTIAL_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RegistryCredentialCollection) Next() (*RegistryCredentialCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RegistryCredentialCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RegistryCredentialClient) ById(id string) (*RegistryCredential, error) { - resp := &RegistryCredential{} - err := c.rancherClient.doById(REGISTRY_CREDENTIAL_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RegistryCredentialClient) Delete(container *RegistryCredential) error { - return c.rancherClient.doResourceDelete(REGISTRY_CREDENTIAL_TYPE, &container.Resource) -} - -func (c *RegistryCredentialClient) ActionActivate(resource *RegistryCredential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryCredentialClient) ActionCreate(resource *RegistryCredential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryCredentialClient) ActionDeactivate(resource *RegistryCredential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryCredentialClient) ActionPurge(resource *RegistryCredential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryCredentialClient) ActionRemove(resource *RegistryCredential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryCredentialClient) ActionUpdate(resource *RegistryCredential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go b/vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go deleted file mode 100644 index bc65daa..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - RESOURCE_DEFINITION_TYPE = "resourceDefinition" -) - -type ResourceDefinition struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} - -type ResourceDefinitionCollection struct { - Collection - Data []ResourceDefinition `json:"data,omitempty"` - client *ResourceDefinitionClient -} - -type ResourceDefinitionClient struct { - rancherClient *RancherClient -} - -type ResourceDefinitionOperations interface { - List(opts *ListOpts) (*ResourceDefinitionCollection, error) - Create(opts *ResourceDefinition) (*ResourceDefinition, error) - Update(existing *ResourceDefinition, updates interface{}) (*ResourceDefinition, error) - ById(id string) (*ResourceDefinition, error) - Delete(container *ResourceDefinition) error -} - -func newResourceDefinitionClient(rancherClient *RancherClient) *ResourceDefinitionClient { - return &ResourceDefinitionClient{ - rancherClient: rancherClient, - } -} - -func (c *ResourceDefinitionClient) Create(container *ResourceDefinition) (*ResourceDefinition, error) { - resp := &ResourceDefinition{} - err := c.rancherClient.doCreate(RESOURCE_DEFINITION_TYPE, container, resp) - return resp, err -} - -func (c *ResourceDefinitionClient) Update(existing *ResourceDefinition, updates interface{}) (*ResourceDefinition, error) { - resp := &ResourceDefinition{} - err := c.rancherClient.doUpdate(RESOURCE_DEFINITION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ResourceDefinitionClient) List(opts *ListOpts) (*ResourceDefinitionCollection, error) { - resp := &ResourceDefinitionCollection{} - err := c.rancherClient.doList(RESOURCE_DEFINITION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ResourceDefinitionCollection) Next() (*ResourceDefinitionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ResourceDefinitionCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ResourceDefinitionClient) ById(id string) (*ResourceDefinition, error) { - resp := &ResourceDefinition{} - err := c.rancherClient.doById(RESOURCE_DEFINITION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ResourceDefinitionClient) Delete(container *ResourceDefinition) error { - return c.rancherClient.doResourceDelete(RESOURCE_DEFINITION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go deleted file mode 100644 index 23c4d81..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - RESTART_POLICY_TYPE = "restartPolicy" -) - -type RestartPolicy struct { - Resource - - MaximumRetryCount int64 `json:"maximumRetryCount,omitempty" yaml:"maximum_retry_count,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} - -type RestartPolicyCollection struct { - Collection - Data []RestartPolicy `json:"data,omitempty"` - client *RestartPolicyClient -} - -type RestartPolicyClient struct { - rancherClient *RancherClient -} - -type RestartPolicyOperations interface { - List(opts *ListOpts) (*RestartPolicyCollection, error) - Create(opts *RestartPolicy) (*RestartPolicy, error) - Update(existing *RestartPolicy, updates interface{}) (*RestartPolicy, error) - ById(id string) (*RestartPolicy, error) - Delete(container *RestartPolicy) error -} - -func newRestartPolicyClient(rancherClient *RancherClient) *RestartPolicyClient { - return &RestartPolicyClient{ - rancherClient: rancherClient, - } -} - -func (c *RestartPolicyClient) Create(container *RestartPolicy) (*RestartPolicy, error) { - resp := &RestartPolicy{} - err := c.rancherClient.doCreate(RESTART_POLICY_TYPE, container, resp) - return resp, err -} - -func (c *RestartPolicyClient) Update(existing *RestartPolicy, updates interface{}) (*RestartPolicy, error) { - resp := &RestartPolicy{} - err := c.rancherClient.doUpdate(RESTART_POLICY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RestartPolicyClient) List(opts *ListOpts) (*RestartPolicyCollection, error) { - resp := &RestartPolicyCollection{} - err := c.rancherClient.doList(RESTART_POLICY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RestartPolicyCollection) Next() (*RestartPolicyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RestartPolicyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RestartPolicyClient) ById(id string) (*RestartPolicy, error) { - resp := &RestartPolicy{} - err := c.rancherClient.doById(RESTART_POLICY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RestartPolicyClient) Delete(container *RestartPolicy) error { - return c.rancherClient.doResourceDelete(RESTART_POLICY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go deleted file mode 100644 index f417808..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - RESTORE_FROM_BACKUP_INPUT_TYPE = "restoreFromBackupInput" -) - -type RestoreFromBackupInput struct { - Resource - - BackupId string `json:"backupId,omitempty" yaml:"backup_id,omitempty"` -} - -type RestoreFromBackupInputCollection struct { - Collection - Data []RestoreFromBackupInput `json:"data,omitempty"` - client *RestoreFromBackupInputClient -} - -type RestoreFromBackupInputClient struct { - rancherClient *RancherClient -} - -type RestoreFromBackupInputOperations interface { - List(opts *ListOpts) (*RestoreFromBackupInputCollection, error) - Create(opts *RestoreFromBackupInput) (*RestoreFromBackupInput, error) - Update(existing *RestoreFromBackupInput, updates interface{}) (*RestoreFromBackupInput, error) - ById(id string) (*RestoreFromBackupInput, error) - Delete(container *RestoreFromBackupInput) error -} - -func newRestoreFromBackupInputClient(rancherClient *RancherClient) *RestoreFromBackupInputClient { - return &RestoreFromBackupInputClient{ - rancherClient: rancherClient, - } -} - -func (c *RestoreFromBackupInputClient) Create(container *RestoreFromBackupInput) (*RestoreFromBackupInput, error) { - resp := &RestoreFromBackupInput{} - err := c.rancherClient.doCreate(RESTORE_FROM_BACKUP_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *RestoreFromBackupInputClient) Update(existing *RestoreFromBackupInput, updates interface{}) (*RestoreFromBackupInput, error) { - resp := &RestoreFromBackupInput{} - err := c.rancherClient.doUpdate(RESTORE_FROM_BACKUP_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RestoreFromBackupInputClient) List(opts *ListOpts) (*RestoreFromBackupInputCollection, error) { - resp := &RestoreFromBackupInputCollection{} - err := c.rancherClient.doList(RESTORE_FROM_BACKUP_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RestoreFromBackupInputCollection) Next() (*RestoreFromBackupInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RestoreFromBackupInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RestoreFromBackupInputClient) ById(id string) (*RestoreFromBackupInput, error) { - resp := &RestoreFromBackupInput{} - err := c.rancherClient.doById(RESTORE_FROM_BACKUP_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RestoreFromBackupInputClient) Delete(container *RestoreFromBackupInput) error { - return c.rancherClient.doResourceDelete(RESTORE_FROM_BACKUP_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go deleted file mode 100644 index 0612f81..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - REVERT_TO_SNAPSHOT_INPUT_TYPE = "revertToSnapshotInput" -) - -type RevertToSnapshotInput struct { - Resource - - SnapshotId string `json:"snapshotId,omitempty" yaml:"snapshot_id,omitempty"` -} - -type RevertToSnapshotInputCollection struct { - Collection - Data []RevertToSnapshotInput `json:"data,omitempty"` - client *RevertToSnapshotInputClient -} - -type RevertToSnapshotInputClient struct { - rancherClient *RancherClient -} - -type RevertToSnapshotInputOperations interface { - List(opts *ListOpts) (*RevertToSnapshotInputCollection, error) - Create(opts *RevertToSnapshotInput) (*RevertToSnapshotInput, error) - Update(existing *RevertToSnapshotInput, updates interface{}) (*RevertToSnapshotInput, error) - ById(id string) (*RevertToSnapshotInput, error) - Delete(container *RevertToSnapshotInput) error -} - -func newRevertToSnapshotInputClient(rancherClient *RancherClient) *RevertToSnapshotInputClient { - return &RevertToSnapshotInputClient{ - rancherClient: rancherClient, - } -} - -func (c *RevertToSnapshotInputClient) Create(container *RevertToSnapshotInput) (*RevertToSnapshotInput, error) { - resp := &RevertToSnapshotInput{} - err := c.rancherClient.doCreate(REVERT_TO_SNAPSHOT_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *RevertToSnapshotInputClient) Update(existing *RevertToSnapshotInput, updates interface{}) (*RevertToSnapshotInput, error) { - resp := &RevertToSnapshotInput{} - err := c.rancherClient.doUpdate(REVERT_TO_SNAPSHOT_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RevertToSnapshotInputClient) List(opts *ListOpts) (*RevertToSnapshotInputCollection, error) { - resp := &RevertToSnapshotInputCollection{} - err := c.rancherClient.doList(REVERT_TO_SNAPSHOT_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RevertToSnapshotInputCollection) Next() (*RevertToSnapshotInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RevertToSnapshotInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RevertToSnapshotInputClient) ById(id string) (*RevertToSnapshotInput, error) { - resp := &RevertToSnapshotInput{} - err := c.rancherClient.doById(REVERT_TO_SNAPSHOT_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RevertToSnapshotInputClient) Delete(container *RevertToSnapshotInput) error { - return c.rancherClient.doResourceDelete(REVERT_TO_SNAPSHOT_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go deleted file mode 100644 index f2384cd..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - ROLLING_RESTART_STRATEGY_TYPE = "rollingRestartStrategy" -) - -type RollingRestartStrategy struct { - Resource - - BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"` - - IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"` -} - -type RollingRestartStrategyCollection struct { - Collection - Data []RollingRestartStrategy `json:"data,omitempty"` - client *RollingRestartStrategyClient -} - -type RollingRestartStrategyClient struct { - rancherClient *RancherClient -} - -type RollingRestartStrategyOperations interface { - List(opts *ListOpts) (*RollingRestartStrategyCollection, error) - Create(opts *RollingRestartStrategy) (*RollingRestartStrategy, error) - Update(existing *RollingRestartStrategy, updates interface{}) (*RollingRestartStrategy, error) - ById(id string) (*RollingRestartStrategy, error) - Delete(container *RollingRestartStrategy) error -} - -func newRollingRestartStrategyClient(rancherClient *RancherClient) *RollingRestartStrategyClient { - return &RollingRestartStrategyClient{ - rancherClient: rancherClient, - } -} - -func (c *RollingRestartStrategyClient) Create(container *RollingRestartStrategy) (*RollingRestartStrategy, error) { - resp := &RollingRestartStrategy{} - err := c.rancherClient.doCreate(ROLLING_RESTART_STRATEGY_TYPE, container, resp) - return resp, err -} - -func (c *RollingRestartStrategyClient) Update(existing *RollingRestartStrategy, updates interface{}) (*RollingRestartStrategy, error) { - resp := &RollingRestartStrategy{} - err := c.rancherClient.doUpdate(ROLLING_RESTART_STRATEGY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RollingRestartStrategyClient) List(opts *ListOpts) (*RollingRestartStrategyCollection, error) { - resp := &RollingRestartStrategyCollection{} - err := c.rancherClient.doList(ROLLING_RESTART_STRATEGY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RollingRestartStrategyCollection) Next() (*RollingRestartStrategyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RollingRestartStrategyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RollingRestartStrategyClient) ById(id string) (*RollingRestartStrategy, error) { - resp := &RollingRestartStrategy{} - err := c.rancherClient.doById(ROLLING_RESTART_STRATEGY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RollingRestartStrategyClient) Delete(container *RollingRestartStrategy) error { - return c.rancherClient.doResourceDelete(ROLLING_RESTART_STRATEGY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go deleted file mode 100644 index eb0ac83..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - SCALE_POLICY_TYPE = "scalePolicy" -) - -type ScalePolicy struct { - Resource - - Increment int64 `json:"increment,omitempty" yaml:"increment,omitempty"` - - Max int64 `json:"max,omitempty" yaml:"max,omitempty"` - - Min int64 `json:"min,omitempty" yaml:"min,omitempty"` -} - -type ScalePolicyCollection struct { - Collection - Data []ScalePolicy `json:"data,omitempty"` - client *ScalePolicyClient -} - -type ScalePolicyClient struct { - rancherClient *RancherClient -} - -type ScalePolicyOperations interface { - List(opts *ListOpts) (*ScalePolicyCollection, error) - Create(opts *ScalePolicy) (*ScalePolicy, error) - Update(existing *ScalePolicy, updates interface{}) (*ScalePolicy, error) - ById(id string) (*ScalePolicy, error) - Delete(container *ScalePolicy) error -} - -func newScalePolicyClient(rancherClient *RancherClient) *ScalePolicyClient { - return &ScalePolicyClient{ - rancherClient: rancherClient, - } -} - -func (c *ScalePolicyClient) Create(container *ScalePolicy) (*ScalePolicy, error) { - resp := &ScalePolicy{} - err := c.rancherClient.doCreate(SCALE_POLICY_TYPE, container, resp) - return resp, err -} - -func (c *ScalePolicyClient) Update(existing *ScalePolicy, updates interface{}) (*ScalePolicy, error) { - resp := &ScalePolicy{} - err := c.rancherClient.doUpdate(SCALE_POLICY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ScalePolicyClient) List(opts *ListOpts) (*ScalePolicyCollection, error) { - resp := &ScalePolicyCollection{} - err := c.rancherClient.doList(SCALE_POLICY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ScalePolicyCollection) Next() (*ScalePolicyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ScalePolicyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ScalePolicyClient) ById(id string) (*ScalePolicy, error) { - resp := &ScalePolicy{} - err := c.rancherClient.doById(SCALE_POLICY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ScalePolicyClient) Delete(container *ScalePolicy) error { - return c.rancherClient.doResourceDelete(SCALE_POLICY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_scheduled_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_scheduled_upgrade.go deleted file mode 100644 index bfe0dfd..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_scheduled_upgrade.go +++ /dev/null @@ -1,136 +0,0 @@ -package client - -const ( - SCHEDULED_UPGRADE_TYPE = "scheduledUpgrade" -) - -type ScheduledUpgrade struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - Started string `json:"started,omitempty" yaml:"started,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ScheduledUpgradeCollection struct { - Collection - Data []ScheduledUpgrade `json:"data,omitempty"` - client *ScheduledUpgradeClient -} - -type ScheduledUpgradeClient struct { - rancherClient *RancherClient -} - -type ScheduledUpgradeOperations interface { - List(opts *ListOpts) (*ScheduledUpgradeCollection, error) - Create(opts *ScheduledUpgrade) (*ScheduledUpgrade, error) - Update(existing *ScheduledUpgrade, updates interface{}) (*ScheduledUpgrade, error) - ById(id string) (*ScheduledUpgrade, error) - Delete(container *ScheduledUpgrade) error - - ActionCreate(*ScheduledUpgrade) (*ScheduledUpgrade, error) - - ActionRemove(*ScheduledUpgrade) (*ScheduledUpgrade, error) - - ActionStart(*ScheduledUpgrade) (*ScheduledUpgrade, error) -} - -func newScheduledUpgradeClient(rancherClient *RancherClient) *ScheduledUpgradeClient { - return &ScheduledUpgradeClient{ - rancherClient: rancherClient, - } -} - -func (c *ScheduledUpgradeClient) Create(container *ScheduledUpgrade) (*ScheduledUpgrade, error) { - resp := &ScheduledUpgrade{} - err := c.rancherClient.doCreate(SCHEDULED_UPGRADE_TYPE, container, resp) - return resp, err -} - -func (c *ScheduledUpgradeClient) Update(existing *ScheduledUpgrade, updates interface{}) (*ScheduledUpgrade, error) { - resp := &ScheduledUpgrade{} - err := c.rancherClient.doUpdate(SCHEDULED_UPGRADE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ScheduledUpgradeClient) List(opts *ListOpts) (*ScheduledUpgradeCollection, error) { - resp := &ScheduledUpgradeCollection{} - err := c.rancherClient.doList(SCHEDULED_UPGRADE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ScheduledUpgradeCollection) Next() (*ScheduledUpgradeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ScheduledUpgradeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ScheduledUpgradeClient) ById(id string) (*ScheduledUpgrade, error) { - resp := &ScheduledUpgrade{} - err := c.rancherClient.doById(SCHEDULED_UPGRADE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ScheduledUpgradeClient) Delete(container *ScheduledUpgrade) error { - return c.rancherClient.doResourceDelete(SCHEDULED_UPGRADE_TYPE, &container.Resource) -} - -func (c *ScheduledUpgradeClient) ActionCreate(resource *ScheduledUpgrade) (*ScheduledUpgrade, error) { - - resp := &ScheduledUpgrade{} - - err := c.rancherClient.doAction(SCHEDULED_UPGRADE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ScheduledUpgradeClient) ActionRemove(resource *ScheduledUpgrade) (*ScheduledUpgrade, error) { - - resp := &ScheduledUpgrade{} - - err := c.rancherClient.doAction(SCHEDULED_UPGRADE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ScheduledUpgradeClient) ActionStart(resource *ScheduledUpgrade) (*ScheduledUpgrade, error) { - - resp := &ScheduledUpgrade{} - - err := c.rancherClient.doAction(SCHEDULED_UPGRADE_TYPE, "start", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go deleted file mode 100644 index b5653fa..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go +++ /dev/null @@ -1,520 +0,0 @@ -package client - -const ( - SECONDARY_LAUNCH_CONFIG_TYPE = "secondaryLaunchConfig" -) - -type SecondaryLaunchConfig struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - AllocationState string `json:"allocationState,omitempty" yaml:"allocation_state,omitempty"` - - BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` - - BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,omitempty"` - - Build *DockerBuild `json:"build,omitempty" yaml:"build,omitempty"` - - CapAdd []string `json:"capAdd,omitempty" yaml:"cap_add,omitempty"` - - CapDrop []string `json:"capDrop,omitempty" yaml:"cap_drop,omitempty"` - - CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` - - Command []string `json:"command,omitempty" yaml:"command,omitempty"` - - Count int64 `json:"count,omitempty" yaml:"count,omitempty"` - - CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` - - CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` - - CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` - - CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` - - CpuRealtimePeriod int64 `json:"cpuRealtimePeriod,omitempty" yaml:"cpu_realtime_period,omitempty"` - - CpuRealtimeRuntime int64 `json:"cpuRealtimeRuntime,omitempty" yaml:"cpu_realtime_runtime,omitempty"` - - CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` - - CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` - - CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DataVolumeMounts map[string]interface{} `json:"dataVolumeMounts,omitempty" yaml:"data_volume_mounts,omitempty"` - - DataVolumes []string `json:"dataVolumes,omitempty" yaml:"data_volumes,omitempty"` - - DataVolumesFrom []string `json:"dataVolumesFrom,omitempty" yaml:"data_volumes_from,omitempty"` - - DataVolumesFromLaunchConfigs []string `json:"dataVolumesFromLaunchConfigs,omitempty" yaml:"data_volumes_from_launch_configs,omitempty"` - - DeploymentUnitUuid string `json:"deploymentUnitUuid,omitempty" yaml:"deployment_unit_uuid,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` - - DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` - - Disks []VirtualMachineDisk `json:"disks,omitempty" yaml:"disks,omitempty"` - - Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` - - DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` - - DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` - - DrainTimeoutMs int64 `json:"drainTimeoutMs,omitempty" yaml:"drain_timeout_ms,omitempty"` - - EntryPoint []string `json:"entryPoint,omitempty" yaml:"entry_point,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - Expose []string `json:"expose,omitempty" yaml:"expose,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExtraHosts []string `json:"extraHosts,omitempty" yaml:"extra_hosts,omitempty"` - - FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` - - GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` - - HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` - - HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` - - HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` - - HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - ImageUuid string `json:"imageUuid,omitempty" yaml:"image_uuid,omitempty"` - - InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` - - InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` - - IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` - - IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` - - Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` - - Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` - - IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` - - Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` - - KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - LogConfig *LogConfig `json:"logConfig,omitempty" yaml:"log_config,omitempty"` - - LxcConf map[string]interface{} `json:"lxcConf,omitempty" yaml:"lxc_conf,omitempty"` - - Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` - - MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` - - MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` - - MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` - - MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` - - MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` - - Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` - - NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` - - NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` - - NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` - - NetworkLaunchConfig string `json:"networkLaunchConfig,omitempty" yaml:"network_launch_config,omitempty"` - - NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` - - OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` - - OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` - - PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` - - PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` - - PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` - - Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` - - PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` - - ReadOnly bool `json:"readOnly,omitempty" yaml:"read_only,omitempty"` - - RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RequestedHostId string `json:"requestedHostId,omitempty" yaml:"requested_host_id,omitempty"` - - RequestedIpAddress string `json:"requestedIpAddress,omitempty" yaml:"requested_ip_address,omitempty"` - - RunInit bool `json:"runInit,omitempty" yaml:"run_init,omitempty"` - - Secrets []SecretReference `json:"secrets,omitempty" yaml:"secrets,omitempty"` - - SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` - - StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` - - StopTimeout int64 `json:"stopTimeout,omitempty" yaml:"stop_timeout,omitempty"` - - StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` - - Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` - - Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` - - User string `json:"user,omitempty" yaml:"user,omitempty"` - - UserPorts []string `json:"userPorts,omitempty" yaml:"user_ports,omitempty"` - - Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` - - UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` - - Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` - - VolumeDriver string `json:"volumeDriver,omitempty" yaml:"volume_driver,omitempty"` - - WorkingDir string `json:"workingDir,omitempty" yaml:"working_dir,omitempty"` -} - -type SecondaryLaunchConfigCollection struct { - Collection - Data []SecondaryLaunchConfig `json:"data,omitempty"` - client *SecondaryLaunchConfigClient -} - -type SecondaryLaunchConfigClient struct { - rancherClient *RancherClient -} - -type SecondaryLaunchConfigOperations interface { - List(opts *ListOpts) (*SecondaryLaunchConfigCollection, error) - Create(opts *SecondaryLaunchConfig) (*SecondaryLaunchConfig, error) - Update(existing *SecondaryLaunchConfig, updates interface{}) (*SecondaryLaunchConfig, error) - ById(id string) (*SecondaryLaunchConfig, error) - Delete(container *SecondaryLaunchConfig) error - - ActionAllocate(*SecondaryLaunchConfig) (*Instance, error) - - ActionConsole(*SecondaryLaunchConfig, *InstanceConsoleInput) (*InstanceConsole, error) - - ActionCreate(*SecondaryLaunchConfig) (*Instance, error) - - ActionDeallocate(*SecondaryLaunchConfig) (*Instance, error) - - ActionError(*SecondaryLaunchConfig) (*Instance, error) - - ActionExecute(*SecondaryLaunchConfig, *ContainerExec) (*HostAccess, error) - - ActionMigrate(*SecondaryLaunchConfig) (*Instance, error) - - ActionProxy(*SecondaryLaunchConfig, *ContainerProxy) (*HostAccess, error) - - ActionPurge(*SecondaryLaunchConfig) (*Instance, error) - - ActionRemove(*SecondaryLaunchConfig) (*Instance, error) - - ActionRestart(*SecondaryLaunchConfig) (*Instance, error) - - ActionStart(*SecondaryLaunchConfig) (*Instance, error) - - ActionStop(*SecondaryLaunchConfig, *InstanceStop) (*Instance, error) - - ActionUpdate(*SecondaryLaunchConfig) (*Instance, error) - - ActionUpdatehealthy(*SecondaryLaunchConfig) (*Instance, error) - - ActionUpdatereinitializing(*SecondaryLaunchConfig) (*Instance, error) - - ActionUpdateunhealthy(*SecondaryLaunchConfig) (*Instance, error) -} - -func newSecondaryLaunchConfigClient(rancherClient *RancherClient) *SecondaryLaunchConfigClient { - return &SecondaryLaunchConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *SecondaryLaunchConfigClient) Create(container *SecondaryLaunchConfig) (*SecondaryLaunchConfig, error) { - resp := &SecondaryLaunchConfig{} - err := c.rancherClient.doCreate(SECONDARY_LAUNCH_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *SecondaryLaunchConfigClient) Update(existing *SecondaryLaunchConfig, updates interface{}) (*SecondaryLaunchConfig, error) { - resp := &SecondaryLaunchConfig{} - err := c.rancherClient.doUpdate(SECONDARY_LAUNCH_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SecondaryLaunchConfigClient) List(opts *ListOpts) (*SecondaryLaunchConfigCollection, error) { - resp := &SecondaryLaunchConfigCollection{} - err := c.rancherClient.doList(SECONDARY_LAUNCH_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SecondaryLaunchConfigCollection) Next() (*SecondaryLaunchConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SecondaryLaunchConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SecondaryLaunchConfigClient) ById(id string) (*SecondaryLaunchConfig, error) { - resp := &SecondaryLaunchConfig{} - err := c.rancherClient.doById(SECONDARY_LAUNCH_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SecondaryLaunchConfigClient) Delete(container *SecondaryLaunchConfig) error { - return c.rancherClient.doResourceDelete(SECONDARY_LAUNCH_CONFIG_TYPE, &container.Resource) -} - -func (c *SecondaryLaunchConfigClient) ActionAllocate(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "allocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionConsole(resource *SecondaryLaunchConfig, input *InstanceConsoleInput) (*InstanceConsole, error) { - - resp := &InstanceConsole{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "console", &resource.Resource, input, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionCreate(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionDeallocate(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "deallocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionError(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionExecute(resource *SecondaryLaunchConfig, input *ContainerExec) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "execute", &resource.Resource, input, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionMigrate(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "migrate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionProxy(resource *SecondaryLaunchConfig, input *ContainerProxy) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "proxy", &resource.Resource, input, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionPurge(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionRemove(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionRestart(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "restart", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionStart(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "start", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionStop(resource *SecondaryLaunchConfig, input *InstanceStop) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "stop", &resource.Resource, input, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionUpdate(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionUpdatehealthy(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "updatehealthy", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionUpdatereinitializing(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "updatereinitializing", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionUpdateunhealthy(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "updateunhealthy", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_secret.go b/vendor/github.com/rancher/go-rancher/v2/generated_secret.go deleted file mode 100644 index 0ae5737..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_secret.go +++ /dev/null @@ -1,127 +0,0 @@ -package client - -const ( - SECRET_TYPE = "secret" -) - -type Secret struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} - -type SecretCollection struct { - Collection - Data []Secret `json:"data,omitempty"` - client *SecretClient -} - -type SecretClient struct { - rancherClient *RancherClient -} - -type SecretOperations interface { - List(opts *ListOpts) (*SecretCollection, error) - Create(opts *Secret) (*Secret, error) - Update(existing *Secret, updates interface{}) (*Secret, error) - ById(id string) (*Secret, error) - Delete(container *Secret) error - - ActionCreate(*Secret) (*Secret, error) - - ActionRemove(*Secret) (*Secret, error) -} - -func newSecretClient(rancherClient *RancherClient) *SecretClient { - return &SecretClient{ - rancherClient: rancherClient, - } -} - -func (c *SecretClient) Create(container *Secret) (*Secret, error) { - resp := &Secret{} - err := c.rancherClient.doCreate(SECRET_TYPE, container, resp) - return resp, err -} - -func (c *SecretClient) Update(existing *Secret, updates interface{}) (*Secret, error) { - resp := &Secret{} - err := c.rancherClient.doUpdate(SECRET_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SecretClient) List(opts *ListOpts) (*SecretCollection, error) { - resp := &SecretCollection{} - err := c.rancherClient.doList(SECRET_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SecretCollection) Next() (*SecretCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SecretCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SecretClient) ById(id string) (*Secret, error) { - resp := &Secret{} - err := c.rancherClient.doById(SECRET_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SecretClient) Delete(container *Secret) error { - return c.rancherClient.doResourceDelete(SECRET_TYPE, &container.Resource) -} - -func (c *SecretClient) ActionCreate(resource *Secret) (*Secret, error) { - - resp := &Secret{} - - err := c.rancherClient.doAction(SECRET_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecretClient) ActionRemove(resource *Secret) (*Secret, error) { - - resp := &Secret{} - - err := c.rancherClient.doAction(SECRET_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_secret_reference.go b/vendor/github.com/rancher/go-rancher/v2/generated_secret_reference.go deleted file mode 100644 index fb6915f..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_secret_reference.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - SECRET_REFERENCE_TYPE = "secretReference" -) - -type SecretReference struct { - Resource - - Gid string `json:"gid,omitempty" yaml:"gid,omitempty"` - - Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - SecretId string `json:"secretId,omitempty" yaml:"secret_id,omitempty"` - - Uid string `json:"uid,omitempty" yaml:"uid,omitempty"` -} - -type SecretReferenceCollection struct { - Collection - Data []SecretReference `json:"data,omitempty"` - client *SecretReferenceClient -} - -type SecretReferenceClient struct { - rancherClient *RancherClient -} - -type SecretReferenceOperations interface { - List(opts *ListOpts) (*SecretReferenceCollection, error) - Create(opts *SecretReference) (*SecretReference, error) - Update(existing *SecretReference, updates interface{}) (*SecretReference, error) - ById(id string) (*SecretReference, error) - Delete(container *SecretReference) error -} - -func newSecretReferenceClient(rancherClient *RancherClient) *SecretReferenceClient { - return &SecretReferenceClient{ - rancherClient: rancherClient, - } -} - -func (c *SecretReferenceClient) Create(container *SecretReference) (*SecretReference, error) { - resp := &SecretReference{} - err := c.rancherClient.doCreate(SECRET_REFERENCE_TYPE, container, resp) - return resp, err -} - -func (c *SecretReferenceClient) Update(existing *SecretReference, updates interface{}) (*SecretReference, error) { - resp := &SecretReference{} - err := c.rancherClient.doUpdate(SECRET_REFERENCE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SecretReferenceClient) List(opts *ListOpts) (*SecretReferenceCollection, error) { - resp := &SecretReferenceCollection{} - err := c.rancherClient.doList(SECRET_REFERENCE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SecretReferenceCollection) Next() (*SecretReferenceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SecretReferenceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SecretReferenceClient) ById(id string) (*SecretReference, error) { - resp := &SecretReference{} - err := c.rancherClient.doById(SECRET_REFERENCE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SecretReferenceClient) Delete(container *SecretReference) error { - return c.rancherClient.doResourceDelete(SECRET_REFERENCE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_service.go deleted file mode 100644 index 4cfb480..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service.go +++ /dev/null @@ -1,303 +0,0 @@ -package client - -const ( - SERVICE_TYPE = "service" -) - -type Service struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LbConfig *LbTargetConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` - - Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` - - ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` - - SecondaryLaunchConfigs []SecondaryLaunchConfig `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` - - SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` - - SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` -} - -type ServiceCollection struct { - Collection - Data []Service `json:"data,omitempty"` - client *ServiceClient -} - -type ServiceClient struct { - rancherClient *RancherClient -} - -type ServiceOperations interface { - List(opts *ListOpts) (*ServiceCollection, error) - Create(opts *Service) (*Service, error) - Update(existing *Service, updates interface{}) (*Service, error) - ById(id string) (*Service, error) - Delete(container *Service) error - - ActionActivate(*Service) (*Service, error) - - ActionAddservicelink(*Service, *AddRemoveServiceLinkInput) (*Service, error) - - ActionCancelupgrade(*Service) (*Service, error) - - ActionContinueupgrade(*Service) (*Service, error) - - ActionCreate(*Service) (*Service, error) - - ActionDeactivate(*Service) (*Service, error) - - ActionFinishupgrade(*Service) (*Service, error) - - ActionRemove(*Service) (*Service, error) - - ActionRemoveservicelink(*Service, *AddRemoveServiceLinkInput) (*Service, error) - - ActionRestart(*Service, *ServiceRestart) (*Service, error) - - ActionRollback(*Service) (*Service, error) - - ActionSetservicelinks(*Service, *SetServiceLinksInput) (*Service, error) - - ActionUpdate(*Service) (*Service, error) - - ActionUpgrade(*Service, *ServiceUpgrade) (*Service, error) -} - -func newServiceClient(rancherClient *RancherClient) *ServiceClient { - return &ServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceClient) Create(container *Service) (*Service, error) { - resp := &Service{} - err := c.rancherClient.doCreate(SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *ServiceClient) Update(existing *Service, updates interface{}) (*Service, error) { - resp := &Service{} - err := c.rancherClient.doUpdate(SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceClient) List(opts *ListOpts) (*ServiceCollection, error) { - resp := &ServiceCollection{} - err := c.rancherClient.doList(SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceCollection) Next() (*ServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceClient) ById(id string) (*Service, error) { - resp := &Service{} - err := c.rancherClient.doById(SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceClient) Delete(container *Service) error { - return c.rancherClient.doResourceDelete(SERVICE_TYPE, &container.Resource) -} - -func (c *ServiceClient) ActionActivate(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionAddservicelink(resource *Service, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ServiceClient) ActionCancelupgrade(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionContinueupgrade(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionCreate(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionDeactivate(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionFinishupgrade(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionRemove(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionRemoveservicelink(resource *Service, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ServiceClient) ActionRestart(resource *Service, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ServiceClient) ActionRollback(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionSetservicelinks(resource *Service, input *SetServiceLinksInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ServiceClient) ActionUpdate(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionUpgrade(resource *Service, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go deleted file mode 100644 index 3626917..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - SERVICE_BINDING_TYPE = "serviceBinding" -) - -type ServiceBinding struct { - Resource - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` -} - -type ServiceBindingCollection struct { - Collection - Data []ServiceBinding `json:"data,omitempty"` - client *ServiceBindingClient -} - -type ServiceBindingClient struct { - rancherClient *RancherClient -} - -type ServiceBindingOperations interface { - List(opts *ListOpts) (*ServiceBindingCollection, error) - Create(opts *ServiceBinding) (*ServiceBinding, error) - Update(existing *ServiceBinding, updates interface{}) (*ServiceBinding, error) - ById(id string) (*ServiceBinding, error) - Delete(container *ServiceBinding) error -} - -func newServiceBindingClient(rancherClient *RancherClient) *ServiceBindingClient { - return &ServiceBindingClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceBindingClient) Create(container *ServiceBinding) (*ServiceBinding, error) { - resp := &ServiceBinding{} - err := c.rancherClient.doCreate(SERVICE_BINDING_TYPE, container, resp) - return resp, err -} - -func (c *ServiceBindingClient) Update(existing *ServiceBinding, updates interface{}) (*ServiceBinding, error) { - resp := &ServiceBinding{} - err := c.rancherClient.doUpdate(SERVICE_BINDING_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceBindingClient) List(opts *ListOpts) (*ServiceBindingCollection, error) { - resp := &ServiceBindingCollection{} - err := c.rancherClient.doList(SERVICE_BINDING_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceBindingCollection) Next() (*ServiceBindingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceBindingCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceBindingClient) ById(id string) (*ServiceBinding, error) { - resp := &ServiceBinding{} - err := c.rancherClient.doById(SERVICE_BINDING_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceBindingClient) Delete(container *ServiceBinding) error { - return c.rancherClient.doResourceDelete(SERVICE_BINDING_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go deleted file mode 100644 index 138afde..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go +++ /dev/null @@ -1,142 +0,0 @@ -package client - -const ( - SERVICE_CONSUME_MAP_TYPE = "serviceConsumeMap" -) - -type ServiceConsumeMap struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - ConsumedServiceId string `json:"consumedServiceId,omitempty" yaml:"consumed_service_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ServiceConsumeMapCollection struct { - Collection - Data []ServiceConsumeMap `json:"data,omitempty"` - client *ServiceConsumeMapClient -} - -type ServiceConsumeMapClient struct { - rancherClient *RancherClient -} - -type ServiceConsumeMapOperations interface { - List(opts *ListOpts) (*ServiceConsumeMapCollection, error) - Create(opts *ServiceConsumeMap) (*ServiceConsumeMap, error) - Update(existing *ServiceConsumeMap, updates interface{}) (*ServiceConsumeMap, error) - ById(id string) (*ServiceConsumeMap, error) - Delete(container *ServiceConsumeMap) error - - ActionCreate(*ServiceConsumeMap) (*ServiceConsumeMap, error) - - ActionRemove(*ServiceConsumeMap) (*ServiceConsumeMap, error) - - ActionUpdate(*ServiceConsumeMap) (*ServiceConsumeMap, error) -} - -func newServiceConsumeMapClient(rancherClient *RancherClient) *ServiceConsumeMapClient { - return &ServiceConsumeMapClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceConsumeMapClient) Create(container *ServiceConsumeMap) (*ServiceConsumeMap, error) { - resp := &ServiceConsumeMap{} - err := c.rancherClient.doCreate(SERVICE_CONSUME_MAP_TYPE, container, resp) - return resp, err -} - -func (c *ServiceConsumeMapClient) Update(existing *ServiceConsumeMap, updates interface{}) (*ServiceConsumeMap, error) { - resp := &ServiceConsumeMap{} - err := c.rancherClient.doUpdate(SERVICE_CONSUME_MAP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceConsumeMapClient) List(opts *ListOpts) (*ServiceConsumeMapCollection, error) { - resp := &ServiceConsumeMapCollection{} - err := c.rancherClient.doList(SERVICE_CONSUME_MAP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceConsumeMapCollection) Next() (*ServiceConsumeMapCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceConsumeMapCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceConsumeMapClient) ById(id string) (*ServiceConsumeMap, error) { - resp := &ServiceConsumeMap{} - err := c.rancherClient.doById(SERVICE_CONSUME_MAP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceConsumeMapClient) Delete(container *ServiceConsumeMap) error { - return c.rancherClient.doResourceDelete(SERVICE_CONSUME_MAP_TYPE, &container.Resource) -} - -func (c *ServiceConsumeMapClient) ActionCreate(resource *ServiceConsumeMap) (*ServiceConsumeMap, error) { - - resp := &ServiceConsumeMap{} - - err := c.rancherClient.doAction(SERVICE_CONSUME_MAP_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceConsumeMapClient) ActionRemove(resource *ServiceConsumeMap) (*ServiceConsumeMap, error) { - - resp := &ServiceConsumeMap{} - - err := c.rancherClient.doAction(SERVICE_CONSUME_MAP_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceConsumeMapClient) ActionUpdate(resource *ServiceConsumeMap) (*ServiceConsumeMap, error) { - - resp := &ServiceConsumeMap{} - - err := c.rancherClient.doAction(SERVICE_CONSUME_MAP_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_event.go deleted file mode 100644 index 71b3082..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_event.go +++ /dev/null @@ -1,135 +0,0 @@ -package client - -const ( - SERVICE_EVENT_TYPE = "serviceEvent" -) - -type ServiceEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalTimestamp int64 `json:"externalTimestamp,omitempty" yaml:"external_timestamp,omitempty"` - - HealthcheckUuid string `json:"healthcheckUuid,omitempty" yaml:"healthcheck_uuid,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ReportedHealth string `json:"reportedHealth,omitempty" yaml:"reported_health,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ServiceEventCollection struct { - Collection - Data []ServiceEvent `json:"data,omitempty"` - client *ServiceEventClient -} - -type ServiceEventClient struct { - rancherClient *RancherClient -} - -type ServiceEventOperations interface { - List(opts *ListOpts) (*ServiceEventCollection, error) - Create(opts *ServiceEvent) (*ServiceEvent, error) - Update(existing *ServiceEvent, updates interface{}) (*ServiceEvent, error) - ById(id string) (*ServiceEvent, error) - Delete(container *ServiceEvent) error - - ActionCreate(*ServiceEvent) (*ServiceEvent, error) - - ActionRemove(*ServiceEvent) (*ServiceEvent, error) -} - -func newServiceEventClient(rancherClient *RancherClient) *ServiceEventClient { - return &ServiceEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceEventClient) Create(container *ServiceEvent) (*ServiceEvent, error) { - resp := &ServiceEvent{} - err := c.rancherClient.doCreate(SERVICE_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ServiceEventClient) Update(existing *ServiceEvent, updates interface{}) (*ServiceEvent, error) { - resp := &ServiceEvent{} - err := c.rancherClient.doUpdate(SERVICE_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceEventClient) List(opts *ListOpts) (*ServiceEventCollection, error) { - resp := &ServiceEventCollection{} - err := c.rancherClient.doList(SERVICE_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceEventCollection) Next() (*ServiceEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceEventClient) ById(id string) (*ServiceEvent, error) { - resp := &ServiceEvent{} - err := c.rancherClient.doById(SERVICE_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceEventClient) Delete(container *ServiceEvent) error { - return c.rancherClient.doResourceDelete(SERVICE_EVENT_TYPE, &container.Resource) -} - -func (c *ServiceEventClient) ActionCreate(resource *ServiceEvent) (*ServiceEvent, error) { - - resp := &ServiceEvent{} - - err := c.rancherClient.doAction(SERVICE_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceEventClient) ActionRemove(resource *ServiceEvent) (*ServiceEvent, error) { - - resp := &ServiceEvent{} - - err := c.rancherClient.doAction(SERVICE_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go deleted file mode 100644 index 06453bf..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go +++ /dev/null @@ -1,133 +0,0 @@ -package client - -const ( - SERVICE_EXPOSE_MAP_TYPE = "serviceExposeMap" -) - -type ServiceExposeMap struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - IpAddress string `json:"ipAddress,omitempty" yaml:"ip_address,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Managed bool `json:"managed,omitempty" yaml:"managed,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ServiceExposeMapCollection struct { - Collection - Data []ServiceExposeMap `json:"data,omitempty"` - client *ServiceExposeMapClient -} - -type ServiceExposeMapClient struct { - rancherClient *RancherClient -} - -type ServiceExposeMapOperations interface { - List(opts *ListOpts) (*ServiceExposeMapCollection, error) - Create(opts *ServiceExposeMap) (*ServiceExposeMap, error) - Update(existing *ServiceExposeMap, updates interface{}) (*ServiceExposeMap, error) - ById(id string) (*ServiceExposeMap, error) - Delete(container *ServiceExposeMap) error - - ActionCreate(*ServiceExposeMap) (*ServiceExposeMap, error) - - ActionRemove(*ServiceExposeMap) (*ServiceExposeMap, error) -} - -func newServiceExposeMapClient(rancherClient *RancherClient) *ServiceExposeMapClient { - return &ServiceExposeMapClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceExposeMapClient) Create(container *ServiceExposeMap) (*ServiceExposeMap, error) { - resp := &ServiceExposeMap{} - err := c.rancherClient.doCreate(SERVICE_EXPOSE_MAP_TYPE, container, resp) - return resp, err -} - -func (c *ServiceExposeMapClient) Update(existing *ServiceExposeMap, updates interface{}) (*ServiceExposeMap, error) { - resp := &ServiceExposeMap{} - err := c.rancherClient.doUpdate(SERVICE_EXPOSE_MAP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceExposeMapClient) List(opts *ListOpts) (*ServiceExposeMapCollection, error) { - resp := &ServiceExposeMapCollection{} - err := c.rancherClient.doList(SERVICE_EXPOSE_MAP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceExposeMapCollection) Next() (*ServiceExposeMapCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceExposeMapCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceExposeMapClient) ById(id string) (*ServiceExposeMap, error) { - resp := &ServiceExposeMap{} - err := c.rancherClient.doById(SERVICE_EXPOSE_MAP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceExposeMapClient) Delete(container *ServiceExposeMap) error { - return c.rancherClient.doResourceDelete(SERVICE_EXPOSE_MAP_TYPE, &container.Resource) -} - -func (c *ServiceExposeMapClient) ActionCreate(resource *ServiceExposeMap) (*ServiceExposeMap, error) { - - resp := &ServiceExposeMap{} - - err := c.rancherClient.doAction(SERVICE_EXPOSE_MAP_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceExposeMapClient) ActionRemove(resource *ServiceExposeMap) (*ServiceExposeMap, error) { - - resp := &ServiceExposeMap{} - - err := c.rancherClient.doAction(SERVICE_EXPOSE_MAP_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_link.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_link.go deleted file mode 100644 index 9532b2a..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_link.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - SERVICE_LINK_TYPE = "serviceLink" -) - -type ServiceLink struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ServiceLinkCollection struct { - Collection - Data []ServiceLink `json:"data,omitempty"` - client *ServiceLinkClient -} - -type ServiceLinkClient struct { - rancherClient *RancherClient -} - -type ServiceLinkOperations interface { - List(opts *ListOpts) (*ServiceLinkCollection, error) - Create(opts *ServiceLink) (*ServiceLink, error) - Update(existing *ServiceLink, updates interface{}) (*ServiceLink, error) - ById(id string) (*ServiceLink, error) - Delete(container *ServiceLink) error -} - -func newServiceLinkClient(rancherClient *RancherClient) *ServiceLinkClient { - return &ServiceLinkClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceLinkClient) Create(container *ServiceLink) (*ServiceLink, error) { - resp := &ServiceLink{} - err := c.rancherClient.doCreate(SERVICE_LINK_TYPE, container, resp) - return resp, err -} - -func (c *ServiceLinkClient) Update(existing *ServiceLink, updates interface{}) (*ServiceLink, error) { - resp := &ServiceLink{} - err := c.rancherClient.doUpdate(SERVICE_LINK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceLinkClient) List(opts *ListOpts) (*ServiceLinkCollection, error) { - resp := &ServiceLinkCollection{} - err := c.rancherClient.doList(SERVICE_LINK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceLinkCollection) Next() (*ServiceLinkCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceLinkCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceLinkClient) ById(id string) (*ServiceLink, error) { - resp := &ServiceLink{} - err := c.rancherClient.doById(SERVICE_LINK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceLinkClient) Delete(container *ServiceLink) error { - return c.rancherClient.doResourceDelete(SERVICE_LINK_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_log.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_log.go deleted file mode 100644 index 81c2236..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_log.go +++ /dev/null @@ -1,101 +0,0 @@ -package client - -const ( - SERVICE_LOG_TYPE = "serviceLog" -) - -type ServiceLog struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - EndTime string `json:"endTime,omitempty" yaml:"end_time,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Level string `json:"level,omitempty" yaml:"level,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - SubLog bool `json:"subLog,omitempty" yaml:"sub_log,omitempty"` - - TransactionId string `json:"transactionId,omitempty" yaml:"transaction_id,omitempty"` -} - -type ServiceLogCollection struct { - Collection - Data []ServiceLog `json:"data,omitempty"` - client *ServiceLogClient -} - -type ServiceLogClient struct { - rancherClient *RancherClient -} - -type ServiceLogOperations interface { - List(opts *ListOpts) (*ServiceLogCollection, error) - Create(opts *ServiceLog) (*ServiceLog, error) - Update(existing *ServiceLog, updates interface{}) (*ServiceLog, error) - ById(id string) (*ServiceLog, error) - Delete(container *ServiceLog) error -} - -func newServiceLogClient(rancherClient *RancherClient) *ServiceLogClient { - return &ServiceLogClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceLogClient) Create(container *ServiceLog) (*ServiceLog, error) { - resp := &ServiceLog{} - err := c.rancherClient.doCreate(SERVICE_LOG_TYPE, container, resp) - return resp, err -} - -func (c *ServiceLogClient) Update(existing *ServiceLog, updates interface{}) (*ServiceLog, error) { - resp := &ServiceLog{} - err := c.rancherClient.doUpdate(SERVICE_LOG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceLogClient) List(opts *ListOpts) (*ServiceLogCollection, error) { - resp := &ServiceLogCollection{} - err := c.rancherClient.doList(SERVICE_LOG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceLogCollection) Next() (*ServiceLogCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceLogCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceLogClient) ById(id string) (*ServiceLog, error) { - resp := &ServiceLog{} - err := c.rancherClient.doById(SERVICE_LOG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceLogClient) Delete(container *ServiceLog) error { - return c.rancherClient.doResourceDelete(SERVICE_LOG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go deleted file mode 100644 index 2af160e..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - SERVICE_PROXY_TYPE = "serviceProxy" -) - -type ServiceProxy struct { - Resource - - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - - Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"` - - Service string `json:"service,omitempty" yaml:"service,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Url string `json:"url,omitempty" yaml:"url,omitempty"` -} - -type ServiceProxyCollection struct { - Collection - Data []ServiceProxy `json:"data,omitempty"` - client *ServiceProxyClient -} - -type ServiceProxyClient struct { - rancherClient *RancherClient -} - -type ServiceProxyOperations interface { - List(opts *ListOpts) (*ServiceProxyCollection, error) - Create(opts *ServiceProxy) (*ServiceProxy, error) - Update(existing *ServiceProxy, updates interface{}) (*ServiceProxy, error) - ById(id string) (*ServiceProxy, error) - Delete(container *ServiceProxy) error -} - -func newServiceProxyClient(rancherClient *RancherClient) *ServiceProxyClient { - return &ServiceProxyClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceProxyClient) Create(container *ServiceProxy) (*ServiceProxy, error) { - resp := &ServiceProxy{} - err := c.rancherClient.doCreate(SERVICE_PROXY_TYPE, container, resp) - return resp, err -} - -func (c *ServiceProxyClient) Update(existing *ServiceProxy, updates interface{}) (*ServiceProxy, error) { - resp := &ServiceProxy{} - err := c.rancherClient.doUpdate(SERVICE_PROXY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceProxyClient) List(opts *ListOpts) (*ServiceProxyCollection, error) { - resp := &ServiceProxyCollection{} - err := c.rancherClient.doList(SERVICE_PROXY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceProxyCollection) Next() (*ServiceProxyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceProxyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceProxyClient) ById(id string) (*ServiceProxy, error) { - resp := &ServiceProxy{} - err := c.rancherClient.doById(SERVICE_PROXY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceProxyClient) Delete(container *ServiceProxy) error { - return c.rancherClient.doResourceDelete(SERVICE_PROXY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go deleted file mode 100644 index 5a47018..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - SERVICE_RESTART_TYPE = "serviceRestart" -) - -type ServiceRestart struct { - Resource - - RollingRestartStrategy RollingRestartStrategy `json:"rollingRestartStrategy,omitempty" yaml:"rolling_restart_strategy,omitempty"` -} - -type ServiceRestartCollection struct { - Collection - Data []ServiceRestart `json:"data,omitempty"` - client *ServiceRestartClient -} - -type ServiceRestartClient struct { - rancherClient *RancherClient -} - -type ServiceRestartOperations interface { - List(opts *ListOpts) (*ServiceRestartCollection, error) - Create(opts *ServiceRestart) (*ServiceRestart, error) - Update(existing *ServiceRestart, updates interface{}) (*ServiceRestart, error) - ById(id string) (*ServiceRestart, error) - Delete(container *ServiceRestart) error -} - -func newServiceRestartClient(rancherClient *RancherClient) *ServiceRestartClient { - return &ServiceRestartClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceRestartClient) Create(container *ServiceRestart) (*ServiceRestart, error) { - resp := &ServiceRestart{} - err := c.rancherClient.doCreate(SERVICE_RESTART_TYPE, container, resp) - return resp, err -} - -func (c *ServiceRestartClient) Update(existing *ServiceRestart, updates interface{}) (*ServiceRestart, error) { - resp := &ServiceRestart{} - err := c.rancherClient.doUpdate(SERVICE_RESTART_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceRestartClient) List(opts *ListOpts) (*ServiceRestartCollection, error) { - resp := &ServiceRestartCollection{} - err := c.rancherClient.doList(SERVICE_RESTART_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceRestartCollection) Next() (*ServiceRestartCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceRestartCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceRestartClient) ById(id string) (*ServiceRestart, error) { - resp := &ServiceRestart{} - err := c.rancherClient.doById(SERVICE_RESTART_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceRestartClient) Delete(container *ServiceRestart) error { - return c.rancherClient.doResourceDelete(SERVICE_RESTART_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go deleted file mode 100644 index 1c97481..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - SERVICE_UPGRADE_TYPE = "serviceUpgrade" -) - -type ServiceUpgrade struct { - Resource - - InServiceStrategy *InServiceUpgradeStrategy `json:"inServiceStrategy,omitempty" yaml:"in_service_strategy,omitempty"` - - ToServiceStrategy *ToServiceUpgradeStrategy `json:"toServiceStrategy,omitempty" yaml:"to_service_strategy,omitempty"` -} - -type ServiceUpgradeCollection struct { - Collection - Data []ServiceUpgrade `json:"data,omitempty"` - client *ServiceUpgradeClient -} - -type ServiceUpgradeClient struct { - rancherClient *RancherClient -} - -type ServiceUpgradeOperations interface { - List(opts *ListOpts) (*ServiceUpgradeCollection, error) - Create(opts *ServiceUpgrade) (*ServiceUpgrade, error) - Update(existing *ServiceUpgrade, updates interface{}) (*ServiceUpgrade, error) - ById(id string) (*ServiceUpgrade, error) - Delete(container *ServiceUpgrade) error -} - -func newServiceUpgradeClient(rancherClient *RancherClient) *ServiceUpgradeClient { - return &ServiceUpgradeClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceUpgradeClient) Create(container *ServiceUpgrade) (*ServiceUpgrade, error) { - resp := &ServiceUpgrade{} - err := c.rancherClient.doCreate(SERVICE_UPGRADE_TYPE, container, resp) - return resp, err -} - -func (c *ServiceUpgradeClient) Update(existing *ServiceUpgrade, updates interface{}) (*ServiceUpgrade, error) { - resp := &ServiceUpgrade{} - err := c.rancherClient.doUpdate(SERVICE_UPGRADE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceUpgradeClient) List(opts *ListOpts) (*ServiceUpgradeCollection, error) { - resp := &ServiceUpgradeCollection{} - err := c.rancherClient.doList(SERVICE_UPGRADE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceUpgradeCollection) Next() (*ServiceUpgradeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceUpgradeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceUpgradeClient) ById(id string) (*ServiceUpgrade, error) { - resp := &ServiceUpgrade{} - err := c.rancherClient.doById(SERVICE_UPGRADE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceUpgradeClient) Delete(container *ServiceUpgrade) error { - return c.rancherClient.doResourceDelete(SERVICE_UPGRADE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go deleted file mode 100644 index 621403d..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - SERVICE_UPGRADE_STRATEGY_TYPE = "serviceUpgradeStrategy" -) - -type ServiceUpgradeStrategy struct { - Resource - - BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"` - - IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"` -} - -type ServiceUpgradeStrategyCollection struct { - Collection - Data []ServiceUpgradeStrategy `json:"data,omitempty"` - client *ServiceUpgradeStrategyClient -} - -type ServiceUpgradeStrategyClient struct { - rancherClient *RancherClient -} - -type ServiceUpgradeStrategyOperations interface { - List(opts *ListOpts) (*ServiceUpgradeStrategyCollection, error) - Create(opts *ServiceUpgradeStrategy) (*ServiceUpgradeStrategy, error) - Update(existing *ServiceUpgradeStrategy, updates interface{}) (*ServiceUpgradeStrategy, error) - ById(id string) (*ServiceUpgradeStrategy, error) - Delete(container *ServiceUpgradeStrategy) error -} - -func newServiceUpgradeStrategyClient(rancherClient *RancherClient) *ServiceUpgradeStrategyClient { - return &ServiceUpgradeStrategyClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceUpgradeStrategyClient) Create(container *ServiceUpgradeStrategy) (*ServiceUpgradeStrategy, error) { - resp := &ServiceUpgradeStrategy{} - err := c.rancherClient.doCreate(SERVICE_UPGRADE_STRATEGY_TYPE, container, resp) - return resp, err -} - -func (c *ServiceUpgradeStrategyClient) Update(existing *ServiceUpgradeStrategy, updates interface{}) (*ServiceUpgradeStrategy, error) { - resp := &ServiceUpgradeStrategy{} - err := c.rancherClient.doUpdate(SERVICE_UPGRADE_STRATEGY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceUpgradeStrategyClient) List(opts *ListOpts) (*ServiceUpgradeStrategyCollection, error) { - resp := &ServiceUpgradeStrategyCollection{} - err := c.rancherClient.doList(SERVICE_UPGRADE_STRATEGY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceUpgradeStrategyCollection) Next() (*ServiceUpgradeStrategyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceUpgradeStrategyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceUpgradeStrategyClient) ById(id string) (*ServiceUpgradeStrategy, error) { - resp := &ServiceUpgradeStrategy{} - err := c.rancherClient.doById(SERVICE_UPGRADE_STRATEGY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceUpgradeStrategyClient) Delete(container *ServiceUpgradeStrategy) error { - return c.rancherClient.doResourceDelete(SERVICE_UPGRADE_STRATEGY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go b/vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go deleted file mode 100644 index 1d112c7..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - SERVICES_PORT_RANGE_TYPE = "servicesPortRange" -) - -type ServicesPortRange struct { - Resource - - EndPort int64 `json:"endPort,omitempty" yaml:"end_port,omitempty"` - - StartPort int64 `json:"startPort,omitempty" yaml:"start_port,omitempty"` -} - -type ServicesPortRangeCollection struct { - Collection - Data []ServicesPortRange `json:"data,omitempty"` - client *ServicesPortRangeClient -} - -type ServicesPortRangeClient struct { - rancherClient *RancherClient -} - -type ServicesPortRangeOperations interface { - List(opts *ListOpts) (*ServicesPortRangeCollection, error) - Create(opts *ServicesPortRange) (*ServicesPortRange, error) - Update(existing *ServicesPortRange, updates interface{}) (*ServicesPortRange, error) - ById(id string) (*ServicesPortRange, error) - Delete(container *ServicesPortRange) error -} - -func newServicesPortRangeClient(rancherClient *RancherClient) *ServicesPortRangeClient { - return &ServicesPortRangeClient{ - rancherClient: rancherClient, - } -} - -func (c *ServicesPortRangeClient) Create(container *ServicesPortRange) (*ServicesPortRange, error) { - resp := &ServicesPortRange{} - err := c.rancherClient.doCreate(SERVICES_PORT_RANGE_TYPE, container, resp) - return resp, err -} - -func (c *ServicesPortRangeClient) Update(existing *ServicesPortRange, updates interface{}) (*ServicesPortRange, error) { - resp := &ServicesPortRange{} - err := c.rancherClient.doUpdate(SERVICES_PORT_RANGE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServicesPortRangeClient) List(opts *ListOpts) (*ServicesPortRangeCollection, error) { - resp := &ServicesPortRangeCollection{} - err := c.rancherClient.doList(SERVICES_PORT_RANGE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServicesPortRangeCollection) Next() (*ServicesPortRangeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServicesPortRangeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServicesPortRangeClient) ById(id string) (*ServicesPortRange, error) { - resp := &ServicesPortRange{} - err := c.rancherClient.doById(SERVICES_PORT_RANGE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServicesPortRangeClient) Delete(container *ServicesPortRange) error { - return c.rancherClient.doResourceDelete(SERVICES_PORT_RANGE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go deleted file mode 100644 index 6d09c9c..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - SET_PROJECT_MEMBERS_INPUT_TYPE = "setProjectMembersInput" -) - -type SetProjectMembersInput struct { - Resource - - Members []ProjectMember `json:"members,omitempty" yaml:"members,omitempty"` -} - -type SetProjectMembersInputCollection struct { - Collection - Data []SetProjectMembersInput `json:"data,omitempty"` - client *SetProjectMembersInputClient -} - -type SetProjectMembersInputClient struct { - rancherClient *RancherClient -} - -type SetProjectMembersInputOperations interface { - List(opts *ListOpts) (*SetProjectMembersInputCollection, error) - Create(opts *SetProjectMembersInput) (*SetProjectMembersInput, error) - Update(existing *SetProjectMembersInput, updates interface{}) (*SetProjectMembersInput, error) - ById(id string) (*SetProjectMembersInput, error) - Delete(container *SetProjectMembersInput) error -} - -func newSetProjectMembersInputClient(rancherClient *RancherClient) *SetProjectMembersInputClient { - return &SetProjectMembersInputClient{ - rancherClient: rancherClient, - } -} - -func (c *SetProjectMembersInputClient) Create(container *SetProjectMembersInput) (*SetProjectMembersInput, error) { - resp := &SetProjectMembersInput{} - err := c.rancherClient.doCreate(SET_PROJECT_MEMBERS_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *SetProjectMembersInputClient) Update(existing *SetProjectMembersInput, updates interface{}) (*SetProjectMembersInput, error) { - resp := &SetProjectMembersInput{} - err := c.rancherClient.doUpdate(SET_PROJECT_MEMBERS_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SetProjectMembersInputClient) List(opts *ListOpts) (*SetProjectMembersInputCollection, error) { - resp := &SetProjectMembersInputCollection{} - err := c.rancherClient.doList(SET_PROJECT_MEMBERS_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SetProjectMembersInputCollection) Next() (*SetProjectMembersInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SetProjectMembersInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SetProjectMembersInputClient) ById(id string) (*SetProjectMembersInput, error) { - resp := &SetProjectMembersInput{} - err := c.rancherClient.doById(SET_PROJECT_MEMBERS_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SetProjectMembersInputClient) Delete(container *SetProjectMembersInput) error { - return c.rancherClient.doResourceDelete(SET_PROJECT_MEMBERS_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go deleted file mode 100644 index a67d8c4..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - SET_SERVICE_LINKS_INPUT_TYPE = "setServiceLinksInput" -) - -type SetServiceLinksInput struct { - Resource - - ServiceLinks []ServiceLink `json:"serviceLinks,omitempty" yaml:"service_links,omitempty"` -} - -type SetServiceLinksInputCollection struct { - Collection - Data []SetServiceLinksInput `json:"data,omitempty"` - client *SetServiceLinksInputClient -} - -type SetServiceLinksInputClient struct { - rancherClient *RancherClient -} - -type SetServiceLinksInputOperations interface { - List(opts *ListOpts) (*SetServiceLinksInputCollection, error) - Create(opts *SetServiceLinksInput) (*SetServiceLinksInput, error) - Update(existing *SetServiceLinksInput, updates interface{}) (*SetServiceLinksInput, error) - ById(id string) (*SetServiceLinksInput, error) - Delete(container *SetServiceLinksInput) error -} - -func newSetServiceLinksInputClient(rancherClient *RancherClient) *SetServiceLinksInputClient { - return &SetServiceLinksInputClient{ - rancherClient: rancherClient, - } -} - -func (c *SetServiceLinksInputClient) Create(container *SetServiceLinksInput) (*SetServiceLinksInput, error) { - resp := &SetServiceLinksInput{} - err := c.rancherClient.doCreate(SET_SERVICE_LINKS_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *SetServiceLinksInputClient) Update(existing *SetServiceLinksInput, updates interface{}) (*SetServiceLinksInput, error) { - resp := &SetServiceLinksInput{} - err := c.rancherClient.doUpdate(SET_SERVICE_LINKS_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SetServiceLinksInputClient) List(opts *ListOpts) (*SetServiceLinksInputCollection, error) { - resp := &SetServiceLinksInputCollection{} - err := c.rancherClient.doList(SET_SERVICE_LINKS_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SetServiceLinksInputCollection) Next() (*SetServiceLinksInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SetServiceLinksInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SetServiceLinksInputClient) ById(id string) (*SetServiceLinksInput, error) { - resp := &SetServiceLinksInput{} - err := c.rancherClient.doById(SET_SERVICE_LINKS_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SetServiceLinksInputClient) Delete(container *SetServiceLinksInput) error { - return c.rancherClient.doResourceDelete(SET_SERVICE_LINKS_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_setting.go b/vendor/github.com/rancher/go-rancher/v2/generated_setting.go deleted file mode 100644 index 02dd2df..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_setting.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - SETTING_TYPE = "setting" -) - -type Setting struct { - Resource - - ActiveValue string `json:"activeValue,omitempty" yaml:"active_value,omitempty"` - - InDb bool `json:"inDb,omitempty" yaml:"in_db,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Source string `json:"source,omitempty" yaml:"source,omitempty"` - - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} - -type SettingCollection struct { - Collection - Data []Setting `json:"data,omitempty"` - client *SettingClient -} - -type SettingClient struct { - rancherClient *RancherClient -} - -type SettingOperations interface { - List(opts *ListOpts) (*SettingCollection, error) - Create(opts *Setting) (*Setting, error) - Update(existing *Setting, updates interface{}) (*Setting, error) - ById(id string) (*Setting, error) - Delete(container *Setting) error -} - -func newSettingClient(rancherClient *RancherClient) *SettingClient { - return &SettingClient{ - rancherClient: rancherClient, - } -} - -func (c *SettingClient) Create(container *Setting) (*Setting, error) { - resp := &Setting{} - err := c.rancherClient.doCreate(SETTING_TYPE, container, resp) - return resp, err -} - -func (c *SettingClient) Update(existing *Setting, updates interface{}) (*Setting, error) { - resp := &Setting{} - err := c.rancherClient.doUpdate(SETTING_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SettingClient) List(opts *ListOpts) (*SettingCollection, error) { - resp := &SettingCollection{} - err := c.rancherClient.doList(SETTING_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SettingCollection) Next() (*SettingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SettingCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SettingClient) ById(id string) (*Setting, error) { - resp := &Setting{} - err := c.rancherClient.doById(SETTING_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SettingClient) Delete(container *Setting) error { - return c.rancherClient.doResourceDelete(SETTING_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go deleted file mode 100644 index 1c4ea03..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go +++ /dev/null @@ -1,138 +0,0 @@ -package client - -const ( - SNAPSHOT_TYPE = "snapshot" -) - -type Snapshot struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` -} - -type SnapshotCollection struct { - Collection - Data []Snapshot `json:"data,omitempty"` - client *SnapshotClient -} - -type SnapshotClient struct { - rancherClient *RancherClient -} - -type SnapshotOperations interface { - List(opts *ListOpts) (*SnapshotCollection, error) - Create(opts *Snapshot) (*Snapshot, error) - Update(existing *Snapshot, updates interface{}) (*Snapshot, error) - ById(id string) (*Snapshot, error) - Delete(container *Snapshot) error - - ActionBackup(*Snapshot, *SnapshotBackupInput) (*Backup, error) - - ActionCreate(*Snapshot) (*Snapshot, error) - - ActionRemove(*Snapshot) (*Snapshot, error) -} - -func newSnapshotClient(rancherClient *RancherClient) *SnapshotClient { - return &SnapshotClient{ - rancherClient: rancherClient, - } -} - -func (c *SnapshotClient) Create(container *Snapshot) (*Snapshot, error) { - resp := &Snapshot{} - err := c.rancherClient.doCreate(SNAPSHOT_TYPE, container, resp) - return resp, err -} - -func (c *SnapshotClient) Update(existing *Snapshot, updates interface{}) (*Snapshot, error) { - resp := &Snapshot{} - err := c.rancherClient.doUpdate(SNAPSHOT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SnapshotClient) List(opts *ListOpts) (*SnapshotCollection, error) { - resp := &SnapshotCollection{} - err := c.rancherClient.doList(SNAPSHOT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SnapshotCollection) Next() (*SnapshotCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SnapshotCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SnapshotClient) ById(id string) (*Snapshot, error) { - resp := &Snapshot{} - err := c.rancherClient.doById(SNAPSHOT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SnapshotClient) Delete(container *Snapshot) error { - return c.rancherClient.doResourceDelete(SNAPSHOT_TYPE, &container.Resource) -} - -func (c *SnapshotClient) ActionBackup(resource *Snapshot, input *SnapshotBackupInput) (*Backup, error) { - - resp := &Backup{} - - err := c.rancherClient.doAction(SNAPSHOT_TYPE, "backup", &resource.Resource, input, resp) - - return resp, err -} - -func (c *SnapshotClient) ActionCreate(resource *Snapshot) (*Snapshot, error) { - - resp := &Snapshot{} - - err := c.rancherClient.doAction(SNAPSHOT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SnapshotClient) ActionRemove(resource *Snapshot) (*Snapshot, error) { - - resp := &Snapshot{} - - err := c.rancherClient.doAction(SNAPSHOT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go deleted file mode 100644 index 9577ee6..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go +++ /dev/null @@ -1,107 +0,0 @@ -package client - -const ( - SNAPSHOT_BACKUP_INPUT_TYPE = "snapshotBackupInput" -) - -type SnapshotBackupInput struct { - Resource - - BackupTargetId string `json:"backupTargetId,omitempty" yaml:"backup_target_id,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` -} - -type SnapshotBackupInputCollection struct { - Collection - Data []SnapshotBackupInput `json:"data,omitempty"` - client *SnapshotBackupInputClient -} - -type SnapshotBackupInputClient struct { - rancherClient *RancherClient -} - -type SnapshotBackupInputOperations interface { - List(opts *ListOpts) (*SnapshotBackupInputCollection, error) - Create(opts *SnapshotBackupInput) (*SnapshotBackupInput, error) - Update(existing *SnapshotBackupInput, updates interface{}) (*SnapshotBackupInput, error) - ById(id string) (*SnapshotBackupInput, error) - Delete(container *SnapshotBackupInput) error - - ActionCreate(*SnapshotBackupInput) (*Backup, error) - - ActionRemove(*SnapshotBackupInput) (*Backup, error) -} - -func newSnapshotBackupInputClient(rancherClient *RancherClient) *SnapshotBackupInputClient { - return &SnapshotBackupInputClient{ - rancherClient: rancherClient, - } -} - -func (c *SnapshotBackupInputClient) Create(container *SnapshotBackupInput) (*SnapshotBackupInput, error) { - resp := &SnapshotBackupInput{} - err := c.rancherClient.doCreate(SNAPSHOT_BACKUP_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *SnapshotBackupInputClient) Update(existing *SnapshotBackupInput, updates interface{}) (*SnapshotBackupInput, error) { - resp := &SnapshotBackupInput{} - err := c.rancherClient.doUpdate(SNAPSHOT_BACKUP_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SnapshotBackupInputClient) List(opts *ListOpts) (*SnapshotBackupInputCollection, error) { - resp := &SnapshotBackupInputCollection{} - err := c.rancherClient.doList(SNAPSHOT_BACKUP_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SnapshotBackupInputCollection) Next() (*SnapshotBackupInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SnapshotBackupInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SnapshotBackupInputClient) ById(id string) (*SnapshotBackupInput, error) { - resp := &SnapshotBackupInput{} - err := c.rancherClient.doById(SNAPSHOT_BACKUP_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SnapshotBackupInputClient) Delete(container *SnapshotBackupInput) error { - return c.rancherClient.doResourceDelete(SNAPSHOT_BACKUP_INPUT_TYPE, &container.Resource) -} - -func (c *SnapshotBackupInputClient) ActionCreate(resource *SnapshotBackupInput) (*Backup, error) { - - resp := &Backup{} - - err := c.rancherClient.doAction(SNAPSHOT_BACKUP_INPUT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SnapshotBackupInputClient) ActionRemove(resource *SnapshotBackupInput) (*Backup, error) { - - resp := &Backup{} - - err := c.rancherClient.doAction(SNAPSHOT_BACKUP_INPUT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_stack.go b/vendor/github.com/rancher/go-rancher/v2/generated_stack.go deleted file mode 100644 index f661218..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_stack.go +++ /dev/null @@ -1,265 +0,0 @@ -package client - -const ( - STACK_TYPE = "stack" -) - -type Stack struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` - - Binding *Binding `json:"binding,omitempty" yaml:"binding,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Group string `json:"group,omitempty" yaml:"group,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Outputs map[string]interface{} `json:"outputs,omitempty" yaml:"outputs,omitempty"` - - PreviousEnvironment map[string]interface{} `json:"previousEnvironment,omitempty" yaml:"previous_environment,omitempty"` - - PreviousExternalId string `json:"previousExternalId,omitempty" yaml:"previous_external_id,omitempty"` - - RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type StackCollection struct { - Collection - Data []Stack `json:"data,omitempty"` - client *StackClient -} - -type StackClient struct { - rancherClient *RancherClient -} - -type StackOperations interface { - List(opts *ListOpts) (*StackCollection, error) - Create(opts *Stack) (*Stack, error) - Update(existing *Stack, updates interface{}) (*Stack, error) - ById(id string) (*Stack, error) - Delete(container *Stack) error - - ActionActivateservices(*Stack) (*Stack, error) - - ActionAddoutputs(*Stack, *AddOutputsInput) (*Stack, error) - - ActionCancelupgrade(*Stack) (*Stack, error) - - ActionCreate(*Stack) (*Stack, error) - - ActionDeactivateservices(*Stack) (*Stack, error) - - ActionError(*Stack) (*Stack, error) - - ActionExportconfig(*Stack, *ComposeConfigInput) (*ComposeConfig, error) - - ActionFinishupgrade(*Stack) (*Stack, error) - - ActionRemove(*Stack) (*Stack, error) - - ActionRollback(*Stack) (*Stack, error) - - ActionUpdate(*Stack) (*Stack, error) - - ActionUpgrade(*Stack, *StackUpgrade) (*Stack, error) -} - -func newStackClient(rancherClient *RancherClient) *StackClient { - return &StackClient{ - rancherClient: rancherClient, - } -} - -func (c *StackClient) Create(container *Stack) (*Stack, error) { - resp := &Stack{} - err := c.rancherClient.doCreate(STACK_TYPE, container, resp) - return resp, err -} - -func (c *StackClient) Update(existing *Stack, updates interface{}) (*Stack, error) { - resp := &Stack{} - err := c.rancherClient.doUpdate(STACK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StackClient) List(opts *ListOpts) (*StackCollection, error) { - resp := &StackCollection{} - err := c.rancherClient.doList(STACK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StackCollection) Next() (*StackCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StackCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StackClient) ById(id string) (*Stack, error) { - resp := &Stack{} - err := c.rancherClient.doById(STACK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StackClient) Delete(container *Stack) error { - return c.rancherClient.doResourceDelete(STACK_TYPE, &container.Resource) -} - -func (c *StackClient) ActionActivateservices(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "activateservices", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionAddoutputs(resource *Stack, input *AddOutputsInput) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "addoutputs", &resource.Resource, input, resp) - - return resp, err -} - -func (c *StackClient) ActionCancelupgrade(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionCreate(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionDeactivateservices(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "deactivateservices", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionError(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionExportconfig(resource *Stack, input *ComposeConfigInput) (*ComposeConfig, error) { - - resp := &ComposeConfig{} - - err := c.rancherClient.doAction(STACK_TYPE, "exportconfig", &resource.Resource, input, resp) - - return resp, err -} - -func (c *StackClient) ActionFinishupgrade(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionRemove(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionRollback(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionUpdate(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionUpgrade(resource *Stack, input *StackUpgrade) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go deleted file mode 100644 index f4f7818..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go +++ /dev/null @@ -1,89 +0,0 @@ -package client - -const ( - STACK_UPGRADE_TYPE = "stackUpgrade" -) - -type StackUpgrade struct { - Resource - - Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` - - DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` - - Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` -} - -type StackUpgradeCollection struct { - Collection - Data []StackUpgrade `json:"data,omitempty"` - client *StackUpgradeClient -} - -type StackUpgradeClient struct { - rancherClient *RancherClient -} - -type StackUpgradeOperations interface { - List(opts *ListOpts) (*StackUpgradeCollection, error) - Create(opts *StackUpgrade) (*StackUpgrade, error) - Update(existing *StackUpgrade, updates interface{}) (*StackUpgrade, error) - ById(id string) (*StackUpgrade, error) - Delete(container *StackUpgrade) error -} - -func newStackUpgradeClient(rancherClient *RancherClient) *StackUpgradeClient { - return &StackUpgradeClient{ - rancherClient: rancherClient, - } -} - -func (c *StackUpgradeClient) Create(container *StackUpgrade) (*StackUpgrade, error) { - resp := &StackUpgrade{} - err := c.rancherClient.doCreate(STACK_UPGRADE_TYPE, container, resp) - return resp, err -} - -func (c *StackUpgradeClient) Update(existing *StackUpgrade, updates interface{}) (*StackUpgrade, error) { - resp := &StackUpgrade{} - err := c.rancherClient.doUpdate(STACK_UPGRADE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StackUpgradeClient) List(opts *ListOpts) (*StackUpgradeCollection, error) { - resp := &StackUpgradeCollection{} - err := c.rancherClient.doList(STACK_UPGRADE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StackUpgradeCollection) Next() (*StackUpgradeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StackUpgradeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StackUpgradeClient) ById(id string) (*StackUpgrade, error) { - resp := &StackUpgrade{} - err := c.rancherClient.doById(STACK_UPGRADE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StackUpgradeClient) Delete(container *StackUpgrade) error { - return c.rancherClient.doResourceDelete(STACK_UPGRADE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go b/vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go deleted file mode 100644 index 4fb5655..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go +++ /dev/null @@ -1,77 +0,0 @@ -package client - -const ( - STATE_TRANSITION_TYPE = "stateTransition" -) - -type StateTransition struct { - Resource -} - -type StateTransitionCollection struct { - Collection - Data []StateTransition `json:"data,omitempty"` - client *StateTransitionClient -} - -type StateTransitionClient struct { - rancherClient *RancherClient -} - -type StateTransitionOperations interface { - List(opts *ListOpts) (*StateTransitionCollection, error) - Create(opts *StateTransition) (*StateTransition, error) - Update(existing *StateTransition, updates interface{}) (*StateTransition, error) - ById(id string) (*StateTransition, error) - Delete(container *StateTransition) error -} - -func newStateTransitionClient(rancherClient *RancherClient) *StateTransitionClient { - return &StateTransitionClient{ - rancherClient: rancherClient, - } -} - -func (c *StateTransitionClient) Create(container *StateTransition) (*StateTransition, error) { - resp := &StateTransition{} - err := c.rancherClient.doCreate(STATE_TRANSITION_TYPE, container, resp) - return resp, err -} - -func (c *StateTransitionClient) Update(existing *StateTransition, updates interface{}) (*StateTransition, error) { - resp := &StateTransition{} - err := c.rancherClient.doUpdate(STATE_TRANSITION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StateTransitionClient) List(opts *ListOpts) (*StateTransitionCollection, error) { - resp := &StateTransitionCollection{} - err := c.rancherClient.doList(STATE_TRANSITION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StateTransitionCollection) Next() (*StateTransitionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StateTransitionCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StateTransitionClient) ById(id string) (*StateTransition, error) { - resp := &StateTransition{} - err := c.rancherClient.doById(STATE_TRANSITION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StateTransitionClient) Delete(container *StateTransition) error { - return c.rancherClient.doResourceDelete(STATE_TRANSITION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go b/vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go deleted file mode 100644 index 1b7d814..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - STATS_ACCESS_TYPE = "statsAccess" -) - -type StatsAccess struct { - Resource - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Url string `json:"url,omitempty" yaml:"url,omitempty"` -} - -type StatsAccessCollection struct { - Collection - Data []StatsAccess `json:"data,omitempty"` - client *StatsAccessClient -} - -type StatsAccessClient struct { - rancherClient *RancherClient -} - -type StatsAccessOperations interface { - List(opts *ListOpts) (*StatsAccessCollection, error) - Create(opts *StatsAccess) (*StatsAccess, error) - Update(existing *StatsAccess, updates interface{}) (*StatsAccess, error) - ById(id string) (*StatsAccess, error) - Delete(container *StatsAccess) error -} - -func newStatsAccessClient(rancherClient *RancherClient) *StatsAccessClient { - return &StatsAccessClient{ - rancherClient: rancherClient, - } -} - -func (c *StatsAccessClient) Create(container *StatsAccess) (*StatsAccess, error) { - resp := &StatsAccess{} - err := c.rancherClient.doCreate(STATS_ACCESS_TYPE, container, resp) - return resp, err -} - -func (c *StatsAccessClient) Update(existing *StatsAccess, updates interface{}) (*StatsAccess, error) { - resp := &StatsAccess{} - err := c.rancherClient.doUpdate(STATS_ACCESS_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StatsAccessClient) List(opts *ListOpts) (*StatsAccessCollection, error) { - resp := &StatsAccessCollection{} - err := c.rancherClient.doList(STATS_ACCESS_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StatsAccessCollection) Next() (*StatsAccessCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StatsAccessCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StatsAccessClient) ById(id string) (*StatsAccess, error) { - resp := &StatsAccess{} - err := c.rancherClient.doById(STATS_ACCESS_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StatsAccessClient) Delete(container *StatsAccess) error { - return c.rancherClient.doResourceDelete(STATS_ACCESS_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go b/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go deleted file mode 100644 index bf54aa4..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go +++ /dev/null @@ -1,168 +0,0 @@ -package client - -const ( - STORAGE_DRIVER_TYPE = "storageDriver" -) - -type StorageDriver struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - BlockDevicePath string `json:"blockDevicePath,omitempty" yaml:"block_device_path,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - Scope string `json:"scope,omitempty" yaml:"scope,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeAccessMode string `json:"volumeAccessMode,omitempty" yaml:"volume_access_mode,omitempty"` - - VolumeCapabilities []string `json:"volumeCapabilities,omitempty" yaml:"volume_capabilities,omitempty"` -} - -type StorageDriverCollection struct { - Collection - Data []StorageDriver `json:"data,omitempty"` - client *StorageDriverClient -} - -type StorageDriverClient struct { - rancherClient *RancherClient -} - -type StorageDriverOperations interface { - List(opts *ListOpts) (*StorageDriverCollection, error) - Create(opts *StorageDriver) (*StorageDriver, error) - Update(existing *StorageDriver, updates interface{}) (*StorageDriver, error) - ById(id string) (*StorageDriver, error) - Delete(container *StorageDriver) error - - ActionActivate(*StorageDriver) (*StorageDriver, error) - - ActionCreate(*StorageDriver) (*StorageDriver, error) - - ActionDeactivate(*StorageDriver) (*StorageDriver, error) - - ActionRemove(*StorageDriver) (*StorageDriver, error) - - ActionUpdate(*StorageDriver) (*StorageDriver, error) -} - -func newStorageDriverClient(rancherClient *RancherClient) *StorageDriverClient { - return &StorageDriverClient{ - rancherClient: rancherClient, - } -} - -func (c *StorageDriverClient) Create(container *StorageDriver) (*StorageDriver, error) { - resp := &StorageDriver{} - err := c.rancherClient.doCreate(STORAGE_DRIVER_TYPE, container, resp) - return resp, err -} - -func (c *StorageDriverClient) Update(existing *StorageDriver, updates interface{}) (*StorageDriver, error) { - resp := &StorageDriver{} - err := c.rancherClient.doUpdate(STORAGE_DRIVER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StorageDriverClient) List(opts *ListOpts) (*StorageDriverCollection, error) { - resp := &StorageDriverCollection{} - err := c.rancherClient.doList(STORAGE_DRIVER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StorageDriverCollection) Next() (*StorageDriverCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StorageDriverCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StorageDriverClient) ById(id string) (*StorageDriver, error) { - resp := &StorageDriver{} - err := c.rancherClient.doById(STORAGE_DRIVER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StorageDriverClient) Delete(container *StorageDriver) error { - return c.rancherClient.doResourceDelete(STORAGE_DRIVER_TYPE, &container.Resource) -} - -func (c *StorageDriverClient) ActionActivate(resource *StorageDriver) (*StorageDriver, error) { - - resp := &StorageDriver{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverClient) ActionCreate(resource *StorageDriver) (*StorageDriver, error) { - - resp := &StorageDriver{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverClient) ActionDeactivate(resource *StorageDriver) (*StorageDriver, error) { - - resp := &StorageDriver{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverClient) ActionRemove(resource *StorageDriver) (*StorageDriver, error) { - - resp := &StorageDriver{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverClient) ActionUpdate(resource *StorageDriver) (*StorageDriver, error) { - - resp := &StorageDriver{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go deleted file mode 100644 index 9fbc365..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go +++ /dev/null @@ -1,305 +0,0 @@ -package client - -const ( - STORAGE_DRIVER_SERVICE_TYPE = "storageDriverService" -) - -type StorageDriverService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LbConfig *LbTargetConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` - - Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` - - ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` - - SecondaryLaunchConfigs []SecondaryLaunchConfig `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` - - SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` - - SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StorageDriver StorageDriver `json:"storageDriver,omitempty" yaml:"storage_driver,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` -} - -type StorageDriverServiceCollection struct { - Collection - Data []StorageDriverService `json:"data,omitempty"` - client *StorageDriverServiceClient -} - -type StorageDriverServiceClient struct { - rancherClient *RancherClient -} - -type StorageDriverServiceOperations interface { - List(opts *ListOpts) (*StorageDriverServiceCollection, error) - Create(opts *StorageDriverService) (*StorageDriverService, error) - Update(existing *StorageDriverService, updates interface{}) (*StorageDriverService, error) - ById(id string) (*StorageDriverService, error) - Delete(container *StorageDriverService) error - - ActionActivate(*StorageDriverService) (*Service, error) - - ActionAddservicelink(*StorageDriverService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionCancelupgrade(*StorageDriverService) (*Service, error) - - ActionContinueupgrade(*StorageDriverService) (*Service, error) - - ActionCreate(*StorageDriverService) (*Service, error) - - ActionDeactivate(*StorageDriverService) (*Service, error) - - ActionFinishupgrade(*StorageDriverService) (*Service, error) - - ActionRemove(*StorageDriverService) (*Service, error) - - ActionRemoveservicelink(*StorageDriverService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionRestart(*StorageDriverService, *ServiceRestart) (*Service, error) - - ActionRollback(*StorageDriverService) (*Service, error) - - ActionSetservicelinks(*StorageDriverService, *SetServiceLinksInput) (*Service, error) - - ActionUpdate(*StorageDriverService) (*Service, error) - - ActionUpgrade(*StorageDriverService, *ServiceUpgrade) (*Service, error) -} - -func newStorageDriverServiceClient(rancherClient *RancherClient) *StorageDriverServiceClient { - return &StorageDriverServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *StorageDriverServiceClient) Create(container *StorageDriverService) (*StorageDriverService, error) { - resp := &StorageDriverService{} - err := c.rancherClient.doCreate(STORAGE_DRIVER_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *StorageDriverServiceClient) Update(existing *StorageDriverService, updates interface{}) (*StorageDriverService, error) { - resp := &StorageDriverService{} - err := c.rancherClient.doUpdate(STORAGE_DRIVER_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StorageDriverServiceClient) List(opts *ListOpts) (*StorageDriverServiceCollection, error) { - resp := &StorageDriverServiceCollection{} - err := c.rancherClient.doList(STORAGE_DRIVER_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StorageDriverServiceCollection) Next() (*StorageDriverServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StorageDriverServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StorageDriverServiceClient) ById(id string) (*StorageDriverService, error) { - resp := &StorageDriverService{} - err := c.rancherClient.doById(STORAGE_DRIVER_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StorageDriverServiceClient) Delete(container *StorageDriverService) error { - return c.rancherClient.doResourceDelete(STORAGE_DRIVER_SERVICE_TYPE, &container.Resource) -} - -func (c *StorageDriverServiceClient) ActionActivate(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionAddservicelink(resource *StorageDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionCancelupgrade(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionContinueupgrade(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionCreate(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionDeactivate(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionFinishupgrade(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionRemove(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionRemoveservicelink(resource *StorageDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionRestart(resource *StorageDriverService, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionRollback(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionSetservicelinks(resource *StorageDriverService, input *SetServiceLinksInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionUpdate(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionUpgrade(resource *StorageDriverService, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go b/vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go deleted file mode 100644 index e77c382..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go +++ /dev/null @@ -1,185 +0,0 @@ -package client - -const ( - STORAGE_POOL_TYPE = "storagePool" -) - -type StoragePool struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - BlockDevicePath string `json:"blockDevicePath,omitempty" yaml:"block_device_path,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DriverName string `json:"driverName,omitempty" yaml:"driver_name,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HostIds []string `json:"hostIds,omitempty" yaml:"host_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StorageDriverId string `json:"storageDriverId,omitempty" yaml:"storage_driver_id,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeAccessMode string `json:"volumeAccessMode,omitempty" yaml:"volume_access_mode,omitempty"` - - VolumeCapabilities []string `json:"volumeCapabilities,omitempty" yaml:"volume_capabilities,omitempty"` - - VolumeIds []string `json:"volumeIds,omitempty" yaml:"volume_ids,omitempty"` -} - -type StoragePoolCollection struct { - Collection - Data []StoragePool `json:"data,omitempty"` - client *StoragePoolClient -} - -type StoragePoolClient struct { - rancherClient *RancherClient -} - -type StoragePoolOperations interface { - List(opts *ListOpts) (*StoragePoolCollection, error) - Create(opts *StoragePool) (*StoragePool, error) - Update(existing *StoragePool, updates interface{}) (*StoragePool, error) - ById(id string) (*StoragePool, error) - Delete(container *StoragePool) error - - ActionActivate(*StoragePool) (*StoragePool, error) - - ActionCreate(*StoragePool) (*StoragePool, error) - - ActionDeactivate(*StoragePool) (*StoragePool, error) - - ActionPurge(*StoragePool) (*StoragePool, error) - - ActionRemove(*StoragePool) (*StoragePool, error) - - ActionUpdate(*StoragePool) (*StoragePool, error) -} - -func newStoragePoolClient(rancherClient *RancherClient) *StoragePoolClient { - return &StoragePoolClient{ - rancherClient: rancherClient, - } -} - -func (c *StoragePoolClient) Create(container *StoragePool) (*StoragePool, error) { - resp := &StoragePool{} - err := c.rancherClient.doCreate(STORAGE_POOL_TYPE, container, resp) - return resp, err -} - -func (c *StoragePoolClient) Update(existing *StoragePool, updates interface{}) (*StoragePool, error) { - resp := &StoragePool{} - err := c.rancherClient.doUpdate(STORAGE_POOL_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StoragePoolClient) List(opts *ListOpts) (*StoragePoolCollection, error) { - resp := &StoragePoolCollection{} - err := c.rancherClient.doList(STORAGE_POOL_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StoragePoolCollection) Next() (*StoragePoolCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StoragePoolCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StoragePoolClient) ById(id string) (*StoragePool, error) { - resp := &StoragePool{} - err := c.rancherClient.doById(STORAGE_POOL_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StoragePoolClient) Delete(container *StoragePool) error { - return c.rancherClient.doResourceDelete(STORAGE_POOL_TYPE, &container.Resource) -} - -func (c *StoragePoolClient) ActionActivate(resource *StoragePool) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StoragePoolClient) ActionCreate(resource *StoragePool) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StoragePoolClient) ActionDeactivate(resource *StoragePool) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StoragePoolClient) ActionPurge(resource *StoragePool) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StoragePoolClient) ActionRemove(resource *StoragePool) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StoragePoolClient) ActionUpdate(resource *StoragePool) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_subnet.go b/vendor/github.com/rancher/go-rancher/v2/generated_subnet.go deleted file mode 100644 index f1a7297..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_subnet.go +++ /dev/null @@ -1,181 +0,0 @@ -package client - -const ( - SUBNET_TYPE = "subnet" -) - -type Subnet struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - CidrSize int64 `json:"cidrSize,omitempty" yaml:"cidr_size,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - EndAddress string `json:"endAddress,omitempty" yaml:"end_address,omitempty"` - - Gateway string `json:"gateway,omitempty" yaml:"gateway,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NetworkAddress string `json:"networkAddress,omitempty" yaml:"network_address,omitempty"` - - NetworkId string `json:"networkId,omitempty" yaml:"network_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - StartAddress string `json:"startAddress,omitempty" yaml:"start_address,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type SubnetCollection struct { - Collection - Data []Subnet `json:"data,omitempty"` - client *SubnetClient -} - -type SubnetClient struct { - rancherClient *RancherClient -} - -type SubnetOperations interface { - List(opts *ListOpts) (*SubnetCollection, error) - Create(opts *Subnet) (*Subnet, error) - Update(existing *Subnet, updates interface{}) (*Subnet, error) - ById(id string) (*Subnet, error) - Delete(container *Subnet) error - - ActionActivate(*Subnet) (*Subnet, error) - - ActionCreate(*Subnet) (*Subnet, error) - - ActionDeactivate(*Subnet) (*Subnet, error) - - ActionPurge(*Subnet) (*Subnet, error) - - ActionRemove(*Subnet) (*Subnet, error) - - ActionUpdate(*Subnet) (*Subnet, error) -} - -func newSubnetClient(rancherClient *RancherClient) *SubnetClient { - return &SubnetClient{ - rancherClient: rancherClient, - } -} - -func (c *SubnetClient) Create(container *Subnet) (*Subnet, error) { - resp := &Subnet{} - err := c.rancherClient.doCreate(SUBNET_TYPE, container, resp) - return resp, err -} - -func (c *SubnetClient) Update(existing *Subnet, updates interface{}) (*Subnet, error) { - resp := &Subnet{} - err := c.rancherClient.doUpdate(SUBNET_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SubnetClient) List(opts *ListOpts) (*SubnetCollection, error) { - resp := &SubnetCollection{} - err := c.rancherClient.doList(SUBNET_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SubnetCollection) Next() (*SubnetCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SubnetCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SubnetClient) ById(id string) (*Subnet, error) { - resp := &Subnet{} - err := c.rancherClient.doById(SUBNET_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SubnetClient) Delete(container *Subnet) error { - return c.rancherClient.doResourceDelete(SUBNET_TYPE, &container.Resource) -} - -func (c *SubnetClient) ActionActivate(resource *Subnet) (*Subnet, error) { - - resp := &Subnet{} - - err := c.rancherClient.doAction(SUBNET_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SubnetClient) ActionCreate(resource *Subnet) (*Subnet, error) { - - resp := &Subnet{} - - err := c.rancherClient.doAction(SUBNET_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SubnetClient) ActionDeactivate(resource *Subnet) (*Subnet, error) { - - resp := &Subnet{} - - err := c.rancherClient.doAction(SUBNET_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SubnetClient) ActionPurge(resource *Subnet) (*Subnet, error) { - - resp := &Subnet{} - - err := c.rancherClient.doAction(SUBNET_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SubnetClient) ActionRemove(resource *Subnet) (*Subnet, error) { - - resp := &Subnet{} - - err := c.rancherClient.doAction(SUBNET_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SubnetClient) ActionUpdate(resource *Subnet) (*Subnet, error) { - - resp := &Subnet{} - - err := c.rancherClient.doAction(SUBNET_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go b/vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go deleted file mode 100644 index 2acc180..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -const ( - TARGET_PORT_RULE_TYPE = "targetPortRule" -) - -type TargetPortRule struct { - Resource - - BackendName string `json:"backendName,omitempty" yaml:"backend_name,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - Path string `json:"path,omitempty" yaml:"path,omitempty"` - - TargetPort int64 `json:"targetPort,omitempty" yaml:"target_port,omitempty"` -} - -type TargetPortRuleCollection struct { - Collection - Data []TargetPortRule `json:"data,omitempty"` - client *TargetPortRuleClient -} - -type TargetPortRuleClient struct { - rancherClient *RancherClient -} - -type TargetPortRuleOperations interface { - List(opts *ListOpts) (*TargetPortRuleCollection, error) - Create(opts *TargetPortRule) (*TargetPortRule, error) - Update(existing *TargetPortRule, updates interface{}) (*TargetPortRule, error) - ById(id string) (*TargetPortRule, error) - Delete(container *TargetPortRule) error -} - -func newTargetPortRuleClient(rancherClient *RancherClient) *TargetPortRuleClient { - return &TargetPortRuleClient{ - rancherClient: rancherClient, - } -} - -func (c *TargetPortRuleClient) Create(container *TargetPortRule) (*TargetPortRule, error) { - resp := &TargetPortRule{} - err := c.rancherClient.doCreate(TARGET_PORT_RULE_TYPE, container, resp) - return resp, err -} - -func (c *TargetPortRuleClient) Update(existing *TargetPortRule, updates interface{}) (*TargetPortRule, error) { - resp := &TargetPortRule{} - err := c.rancherClient.doUpdate(TARGET_PORT_RULE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TargetPortRuleClient) List(opts *ListOpts) (*TargetPortRuleCollection, error) { - resp := &TargetPortRuleCollection{} - err := c.rancherClient.doList(TARGET_PORT_RULE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *TargetPortRuleCollection) Next() (*TargetPortRuleCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TargetPortRuleCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TargetPortRuleClient) ById(id string) (*TargetPortRule, error) { - resp := &TargetPortRule{} - err := c.rancherClient.doById(TARGET_PORT_RULE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *TargetPortRuleClient) Delete(container *TargetPortRule) error { - return c.rancherClient.doResourceDelete(TARGET_PORT_RULE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_task.go b/vendor/github.com/rancher/go-rancher/v2/generated_task.go deleted file mode 100644 index 8fa65e2..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_task.go +++ /dev/null @@ -1,90 +0,0 @@ -package client - -const ( - TASK_TYPE = "task" -) - -type Task struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} - -type TaskCollection struct { - Collection - Data []Task `json:"data,omitempty"` - client *TaskClient -} - -type TaskClient struct { - rancherClient *RancherClient -} - -type TaskOperations interface { - List(opts *ListOpts) (*TaskCollection, error) - Create(opts *Task) (*Task, error) - Update(existing *Task, updates interface{}) (*Task, error) - ById(id string) (*Task, error) - Delete(container *Task) error - - ActionExecute(*Task) (*Task, error) -} - -func newTaskClient(rancherClient *RancherClient) *TaskClient { - return &TaskClient{ - rancherClient: rancherClient, - } -} - -func (c *TaskClient) Create(container *Task) (*Task, error) { - resp := &Task{} - err := c.rancherClient.doCreate(TASK_TYPE, container, resp) - return resp, err -} - -func (c *TaskClient) Update(existing *Task, updates interface{}) (*Task, error) { - resp := &Task{} - err := c.rancherClient.doUpdate(TASK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TaskClient) List(opts *ListOpts) (*TaskCollection, error) { - resp := &TaskCollection{} - err := c.rancherClient.doList(TASK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *TaskCollection) Next() (*TaskCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TaskCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TaskClient) ById(id string) (*Task, error) { - resp := &Task{} - err := c.rancherClient.doById(TASK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *TaskClient) Delete(container *Task) error { - return c.rancherClient.doResourceDelete(TASK_TYPE, &container.Resource) -} - -func (c *TaskClient) ActionExecute(resource *Task) (*Task, error) { - - resp := &Task{} - - err := c.rancherClient.doAction(TASK_TYPE, "execute", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go deleted file mode 100644 index 5bb5827..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go +++ /dev/null @@ -1,89 +0,0 @@ -package client - -const ( - TASK_INSTANCE_TYPE = "taskInstance" -) - -type TaskInstance struct { - Resource - - EndTime string `json:"endTime,omitempty" yaml:"end_time,omitempty"` - - Exception string `json:"exception,omitempty" yaml:"exception,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - ServerId string `json:"serverId,omitempty" yaml:"server_id,omitempty"` - - StartTime string `json:"startTime,omitempty" yaml:"start_time,omitempty"` - - TaskId string `json:"taskId,omitempty" yaml:"task_id,omitempty"` -} - -type TaskInstanceCollection struct { - Collection - Data []TaskInstance `json:"data,omitempty"` - client *TaskInstanceClient -} - -type TaskInstanceClient struct { - rancherClient *RancherClient -} - -type TaskInstanceOperations interface { - List(opts *ListOpts) (*TaskInstanceCollection, error) - Create(opts *TaskInstance) (*TaskInstance, error) - Update(existing *TaskInstance, updates interface{}) (*TaskInstance, error) - ById(id string) (*TaskInstance, error) - Delete(container *TaskInstance) error -} - -func newTaskInstanceClient(rancherClient *RancherClient) *TaskInstanceClient { - return &TaskInstanceClient{ - rancherClient: rancherClient, - } -} - -func (c *TaskInstanceClient) Create(container *TaskInstance) (*TaskInstance, error) { - resp := &TaskInstance{} - err := c.rancherClient.doCreate(TASK_INSTANCE_TYPE, container, resp) - return resp, err -} - -func (c *TaskInstanceClient) Update(existing *TaskInstance, updates interface{}) (*TaskInstance, error) { - resp := &TaskInstance{} - err := c.rancherClient.doUpdate(TASK_INSTANCE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TaskInstanceClient) List(opts *ListOpts) (*TaskInstanceCollection, error) { - resp := &TaskInstanceCollection{} - err := c.rancherClient.doList(TASK_INSTANCE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *TaskInstanceCollection) Next() (*TaskInstanceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TaskInstanceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TaskInstanceClient) ById(id string) (*TaskInstance, error) { - resp := &TaskInstance{} - err := c.rancherClient.doById(TASK_INSTANCE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *TaskInstanceClient) Delete(container *TaskInstance) error { - return c.rancherClient.doResourceDelete(TASK_INSTANCE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go deleted file mode 100644 index 3ed7411..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - TO_SERVICE_UPGRADE_STRATEGY_TYPE = "toServiceUpgradeStrategy" -) - -type ToServiceUpgradeStrategy struct { - Resource - - BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"` - - FinalScale int64 `json:"finalScale,omitempty" yaml:"final_scale,omitempty"` - - IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"` - - ToServiceId string `json:"toServiceId,omitempty" yaml:"to_service_id,omitempty"` - - UpdateLinks bool `json:"updateLinks,omitempty" yaml:"update_links,omitempty"` -} - -type ToServiceUpgradeStrategyCollection struct { - Collection - Data []ToServiceUpgradeStrategy `json:"data,omitempty"` - client *ToServiceUpgradeStrategyClient -} - -type ToServiceUpgradeStrategyClient struct { - rancherClient *RancherClient -} - -type ToServiceUpgradeStrategyOperations interface { - List(opts *ListOpts) (*ToServiceUpgradeStrategyCollection, error) - Create(opts *ToServiceUpgradeStrategy) (*ToServiceUpgradeStrategy, error) - Update(existing *ToServiceUpgradeStrategy, updates interface{}) (*ToServiceUpgradeStrategy, error) - ById(id string) (*ToServiceUpgradeStrategy, error) - Delete(container *ToServiceUpgradeStrategy) error -} - -func newToServiceUpgradeStrategyClient(rancherClient *RancherClient) *ToServiceUpgradeStrategyClient { - return &ToServiceUpgradeStrategyClient{ - rancherClient: rancherClient, - } -} - -func (c *ToServiceUpgradeStrategyClient) Create(container *ToServiceUpgradeStrategy) (*ToServiceUpgradeStrategy, error) { - resp := &ToServiceUpgradeStrategy{} - err := c.rancherClient.doCreate(TO_SERVICE_UPGRADE_STRATEGY_TYPE, container, resp) - return resp, err -} - -func (c *ToServiceUpgradeStrategyClient) Update(existing *ToServiceUpgradeStrategy, updates interface{}) (*ToServiceUpgradeStrategy, error) { - resp := &ToServiceUpgradeStrategy{} - err := c.rancherClient.doUpdate(TO_SERVICE_UPGRADE_STRATEGY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ToServiceUpgradeStrategyClient) List(opts *ListOpts) (*ToServiceUpgradeStrategyCollection, error) { - resp := &ToServiceUpgradeStrategyCollection{} - err := c.rancherClient.doList(TO_SERVICE_UPGRADE_STRATEGY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ToServiceUpgradeStrategyCollection) Next() (*ToServiceUpgradeStrategyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ToServiceUpgradeStrategyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ToServiceUpgradeStrategyClient) ById(id string) (*ToServiceUpgradeStrategy, error) { - resp := &ToServiceUpgradeStrategy{} - err := c.rancherClient.doById(TO_SERVICE_UPGRADE_STRATEGY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ToServiceUpgradeStrategyClient) Delete(container *ToServiceUpgradeStrategy) error { - return c.rancherClient.doResourceDelete(TO_SERVICE_UPGRADE_STRATEGY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go b/vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go deleted file mode 100644 index cdfe186..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - TYPE_DOCUMENTATION_TYPE = "typeDocumentation" -) - -type TypeDocumentation struct { - Resource - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ResourceFields map[string]interface{} `json:"resourceFields,omitempty" yaml:"resource_fields,omitempty"` -} - -type TypeDocumentationCollection struct { - Collection - Data []TypeDocumentation `json:"data,omitempty"` - client *TypeDocumentationClient -} - -type TypeDocumentationClient struct { - rancherClient *RancherClient -} - -type TypeDocumentationOperations interface { - List(opts *ListOpts) (*TypeDocumentationCollection, error) - Create(opts *TypeDocumentation) (*TypeDocumentation, error) - Update(existing *TypeDocumentation, updates interface{}) (*TypeDocumentation, error) - ById(id string) (*TypeDocumentation, error) - Delete(container *TypeDocumentation) error -} - -func newTypeDocumentationClient(rancherClient *RancherClient) *TypeDocumentationClient { - return &TypeDocumentationClient{ - rancherClient: rancherClient, - } -} - -func (c *TypeDocumentationClient) Create(container *TypeDocumentation) (*TypeDocumentation, error) { - resp := &TypeDocumentation{} - err := c.rancherClient.doCreate(TYPE_DOCUMENTATION_TYPE, container, resp) - return resp, err -} - -func (c *TypeDocumentationClient) Update(existing *TypeDocumentation, updates interface{}) (*TypeDocumentation, error) { - resp := &TypeDocumentation{} - err := c.rancherClient.doUpdate(TYPE_DOCUMENTATION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TypeDocumentationClient) List(opts *ListOpts) (*TypeDocumentationCollection, error) { - resp := &TypeDocumentationCollection{} - err := c.rancherClient.doList(TYPE_DOCUMENTATION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *TypeDocumentationCollection) Next() (*TypeDocumentationCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TypeDocumentationCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TypeDocumentationClient) ById(id string) (*TypeDocumentation, error) { - resp := &TypeDocumentation{} - err := c.rancherClient.doById(TYPE_DOCUMENTATION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *TypeDocumentationClient) Delete(container *TypeDocumentation) error { - return c.rancherClient.doResourceDelete(TYPE_DOCUMENTATION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go b/vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go deleted file mode 100644 index 7449c26..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - ULIMIT_TYPE = "ulimit" -) - -type Ulimit struct { - Resource - - Hard int64 `json:"hard,omitempty" yaml:"hard,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Soft int64 `json:"soft,omitempty" yaml:"soft,omitempty"` -} - -type UlimitCollection struct { - Collection - Data []Ulimit `json:"data,omitempty"` - client *UlimitClient -} - -type UlimitClient struct { - rancherClient *RancherClient -} - -type UlimitOperations interface { - List(opts *ListOpts) (*UlimitCollection, error) - Create(opts *Ulimit) (*Ulimit, error) - Update(existing *Ulimit, updates interface{}) (*Ulimit, error) - ById(id string) (*Ulimit, error) - Delete(container *Ulimit) error -} - -func newUlimitClient(rancherClient *RancherClient) *UlimitClient { - return &UlimitClient{ - rancherClient: rancherClient, - } -} - -func (c *UlimitClient) Create(container *Ulimit) (*Ulimit, error) { - resp := &Ulimit{} - err := c.rancherClient.doCreate(ULIMIT_TYPE, container, resp) - return resp, err -} - -func (c *UlimitClient) Update(existing *Ulimit, updates interface{}) (*Ulimit, error) { - resp := &Ulimit{} - err := c.rancherClient.doUpdate(ULIMIT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *UlimitClient) List(opts *ListOpts) (*UlimitCollection, error) { - resp := &UlimitCollection{} - err := c.rancherClient.doList(ULIMIT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *UlimitCollection) Next() (*UlimitCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &UlimitCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *UlimitClient) ById(id string) (*Ulimit, error) { - resp := &Ulimit{} - err := c.rancherClient.doById(ULIMIT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *UlimitClient) Delete(container *Ulimit) error { - return c.rancherClient.doResourceDelete(ULIMIT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_user_preference.go b/vendor/github.com/rancher/go-rancher/v2/generated_user_preference.go deleted file mode 100644 index 815b87d..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_user_preference.go +++ /dev/null @@ -1,173 +0,0 @@ -package client - -const ( - USER_PREFERENCE_TYPE = "userPreference" -) - -type UserPreference struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - All bool `json:"all,omitempty" yaml:"all,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} - -type UserPreferenceCollection struct { - Collection - Data []UserPreference `json:"data,omitempty"` - client *UserPreferenceClient -} - -type UserPreferenceClient struct { - rancherClient *RancherClient -} - -type UserPreferenceOperations interface { - List(opts *ListOpts) (*UserPreferenceCollection, error) - Create(opts *UserPreference) (*UserPreference, error) - Update(existing *UserPreference, updates interface{}) (*UserPreference, error) - ById(id string) (*UserPreference, error) - Delete(container *UserPreference) error - - ActionActivate(*UserPreference) (*UserPreference, error) - - ActionCreate(*UserPreference) (*UserPreference, error) - - ActionDeactivate(*UserPreference) (*UserPreference, error) - - ActionPurge(*UserPreference) (*UserPreference, error) - - ActionRemove(*UserPreference) (*UserPreference, error) - - ActionUpdate(*UserPreference) (*UserPreference, error) -} - -func newUserPreferenceClient(rancherClient *RancherClient) *UserPreferenceClient { - return &UserPreferenceClient{ - rancherClient: rancherClient, - } -} - -func (c *UserPreferenceClient) Create(container *UserPreference) (*UserPreference, error) { - resp := &UserPreference{} - err := c.rancherClient.doCreate(USER_PREFERENCE_TYPE, container, resp) - return resp, err -} - -func (c *UserPreferenceClient) Update(existing *UserPreference, updates interface{}) (*UserPreference, error) { - resp := &UserPreference{} - err := c.rancherClient.doUpdate(USER_PREFERENCE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *UserPreferenceClient) List(opts *ListOpts) (*UserPreferenceCollection, error) { - resp := &UserPreferenceCollection{} - err := c.rancherClient.doList(USER_PREFERENCE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *UserPreferenceCollection) Next() (*UserPreferenceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &UserPreferenceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *UserPreferenceClient) ById(id string) (*UserPreference, error) { - resp := &UserPreference{} - err := c.rancherClient.doById(USER_PREFERENCE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *UserPreferenceClient) Delete(container *UserPreference) error { - return c.rancherClient.doResourceDelete(USER_PREFERENCE_TYPE, &container.Resource) -} - -func (c *UserPreferenceClient) ActionActivate(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionCreate(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionDeactivate(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionPurge(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionRemove(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionUpdate(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go deleted file mode 100644 index 69327b2..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go +++ /dev/null @@ -1,485 +0,0 @@ -package client - -const ( - VIRTUAL_MACHINE_TYPE = "virtualMachine" -) - -type VirtualMachine struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - AllocationState string `json:"allocationState,omitempty" yaml:"allocation_state,omitempty"` - - BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` - - BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,omitempty"` - - CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` - - Command []string `json:"command,omitempty" yaml:"command,omitempty"` - - Count int64 `json:"count,omitempty" yaml:"count,omitempty"` - - CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` - - CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` - - CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` - - CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` - - CpuRealtimePeriod int64 `json:"cpuRealtimePeriod,omitempty" yaml:"cpu_realtime_period,omitempty"` - - CpuRealtimeRuntime int64 `json:"cpuRealtimeRuntime,omitempty" yaml:"cpu_realtime_runtime,omitempty"` - - CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` - - CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` - - CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DeploymentUnitUuid string `json:"deploymentUnitUuid,omitempty" yaml:"deployment_unit_uuid,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` - - Disks []VirtualMachineDisk `json:"disks,omitempty" yaml:"disks,omitempty"` - - Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` - - DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` - - DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` - - Expose []string `json:"expose,omitempty" yaml:"expose,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExtraHosts []string `json:"extraHosts,omitempty" yaml:"extra_hosts,omitempty"` - - FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` - - GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` - - HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` - - HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` - - HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` - - HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - ImageUuid string `json:"imageUuid,omitempty" yaml:"image_uuid,omitempty"` - - InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` - - InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` - - IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` - - IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` - - Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` - - Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` - - IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` - - Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` - - KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - LogConfig *LogConfig `json:"logConfig,omitempty" yaml:"log_config,omitempty"` - - Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` - - MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` - - MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` - - MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` - - MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` - - MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` - - Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` - - NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` - - NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` - - NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` - - OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` - - OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` - - PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` - - PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` - - RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RequestedHostId string `json:"requestedHostId,omitempty" yaml:"requested_host_id,omitempty"` - - RestartPolicy *RestartPolicy `json:"restartPolicy,omitempty" yaml:"restart_policy,omitempty"` - - RunInit bool `json:"runInit,omitempty" yaml:"run_init,omitempty"` - - SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` - - StopTimeout int64 `json:"stopTimeout,omitempty" yaml:"stop_timeout,omitempty"` - - StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` - - Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` - - UserPorts []string `json:"userPorts,omitempty" yaml:"user_ports,omitempty"` - - Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` - - UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` - - Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` - - VolumeDriver string `json:"volumeDriver,omitempty" yaml:"volume_driver,omitempty"` -} - -type VirtualMachineCollection struct { - Collection - Data []VirtualMachine `json:"data,omitempty"` - client *VirtualMachineClient -} - -type VirtualMachineClient struct { - rancherClient *RancherClient -} - -type VirtualMachineOperations interface { - List(opts *ListOpts) (*VirtualMachineCollection, error) - Create(opts *VirtualMachine) (*VirtualMachine, error) - Update(existing *VirtualMachine, updates interface{}) (*VirtualMachine, error) - ById(id string) (*VirtualMachine, error) - Delete(container *VirtualMachine) error - - ActionAllocate(*VirtualMachine) (*Instance, error) - - ActionConsole(*VirtualMachine, *InstanceConsoleInput) (*InstanceConsole, error) - - ActionCreate(*VirtualMachine) (*Instance, error) - - ActionDeallocate(*VirtualMachine) (*Instance, error) - - ActionError(*VirtualMachine) (*Instance, error) - - ActionExecute(*VirtualMachine, *ContainerExec) (*HostAccess, error) - - ActionLogs(*VirtualMachine, *ContainerLogs) (*HostAccess, error) - - ActionMigrate(*VirtualMachine) (*Instance, error) - - ActionProxy(*VirtualMachine, *ContainerProxy) (*HostAccess, error) - - ActionPurge(*VirtualMachine) (*Instance, error) - - ActionRemove(*VirtualMachine) (*Instance, error) - - ActionRestart(*VirtualMachine) (*Instance, error) - - ActionStart(*VirtualMachine) (*Instance, error) - - ActionStop(*VirtualMachine, *InstanceStop) (*Instance, error) - - ActionUpdate(*VirtualMachine) (*Instance, error) - - ActionUpdatehealthy(*VirtualMachine) (*Instance, error) - - ActionUpdatereinitializing(*VirtualMachine) (*Instance, error) - - ActionUpdateunhealthy(*VirtualMachine) (*Instance, error) -} - -func newVirtualMachineClient(rancherClient *RancherClient) *VirtualMachineClient { - return &VirtualMachineClient{ - rancherClient: rancherClient, - } -} - -func (c *VirtualMachineClient) Create(container *VirtualMachine) (*VirtualMachine, error) { - resp := &VirtualMachine{} - err := c.rancherClient.doCreate(VIRTUAL_MACHINE_TYPE, container, resp) - return resp, err -} - -func (c *VirtualMachineClient) Update(existing *VirtualMachine, updates interface{}) (*VirtualMachine, error) { - resp := &VirtualMachine{} - err := c.rancherClient.doUpdate(VIRTUAL_MACHINE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VirtualMachineClient) List(opts *ListOpts) (*VirtualMachineCollection, error) { - resp := &VirtualMachineCollection{} - err := c.rancherClient.doList(VIRTUAL_MACHINE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *VirtualMachineCollection) Next() (*VirtualMachineCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &VirtualMachineCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *VirtualMachineClient) ById(id string) (*VirtualMachine, error) { - resp := &VirtualMachine{} - err := c.rancherClient.doById(VIRTUAL_MACHINE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VirtualMachineClient) Delete(container *VirtualMachine) error { - return c.rancherClient.doResourceDelete(VIRTUAL_MACHINE_TYPE, &container.Resource) -} - -func (c *VirtualMachineClient) ActionAllocate(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "allocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionConsole(resource *VirtualMachine, input *InstanceConsoleInput) (*InstanceConsole, error) { - - resp := &InstanceConsole{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "console", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionCreate(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionDeallocate(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "deallocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionError(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionExecute(resource *VirtualMachine, input *ContainerExec) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "execute", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionLogs(resource *VirtualMachine, input *ContainerLogs) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "logs", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionMigrate(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "migrate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionProxy(resource *VirtualMachine, input *ContainerProxy) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "proxy", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionPurge(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionRemove(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionRestart(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "restart", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionStart(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "start", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionStop(resource *VirtualMachine, input *InstanceStop) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "stop", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionUpdate(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionUpdatehealthy(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "updatehealthy", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionUpdatereinitializing(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "updatereinitializing", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionUpdateunhealthy(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "updateunhealthy", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go deleted file mode 100644 index af52418..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go +++ /dev/null @@ -1,91 +0,0 @@ -package client - -const ( - VIRTUAL_MACHINE_DISK_TYPE = "virtualMachineDisk" -) - -type VirtualMachineDisk struct { - Resource - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Opts map[string]interface{} `json:"opts,omitempty" yaml:"opts,omitempty"` - - ReadIops int64 `json:"readIops,omitempty" yaml:"read_iops,omitempty"` - - Root bool `json:"root,omitempty" yaml:"root,omitempty"` - - Size string `json:"size,omitempty" yaml:"size,omitempty"` - - WriteIops int64 `json:"writeIops,omitempty" yaml:"write_iops,omitempty"` -} - -type VirtualMachineDiskCollection struct { - Collection - Data []VirtualMachineDisk `json:"data,omitempty"` - client *VirtualMachineDiskClient -} - -type VirtualMachineDiskClient struct { - rancherClient *RancherClient -} - -type VirtualMachineDiskOperations interface { - List(opts *ListOpts) (*VirtualMachineDiskCollection, error) - Create(opts *VirtualMachineDisk) (*VirtualMachineDisk, error) - Update(existing *VirtualMachineDisk, updates interface{}) (*VirtualMachineDisk, error) - ById(id string) (*VirtualMachineDisk, error) - Delete(container *VirtualMachineDisk) error -} - -func newVirtualMachineDiskClient(rancherClient *RancherClient) *VirtualMachineDiskClient { - return &VirtualMachineDiskClient{ - rancherClient: rancherClient, - } -} - -func (c *VirtualMachineDiskClient) Create(container *VirtualMachineDisk) (*VirtualMachineDisk, error) { - resp := &VirtualMachineDisk{} - err := c.rancherClient.doCreate(VIRTUAL_MACHINE_DISK_TYPE, container, resp) - return resp, err -} - -func (c *VirtualMachineDiskClient) Update(existing *VirtualMachineDisk, updates interface{}) (*VirtualMachineDisk, error) { - resp := &VirtualMachineDisk{} - err := c.rancherClient.doUpdate(VIRTUAL_MACHINE_DISK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VirtualMachineDiskClient) List(opts *ListOpts) (*VirtualMachineDiskCollection, error) { - resp := &VirtualMachineDiskCollection{} - err := c.rancherClient.doList(VIRTUAL_MACHINE_DISK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *VirtualMachineDiskCollection) Next() (*VirtualMachineDiskCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &VirtualMachineDiskCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *VirtualMachineDiskClient) ById(id string) (*VirtualMachineDisk, error) { - resp := &VirtualMachineDisk{} - err := c.rancherClient.doById(VIRTUAL_MACHINE_DISK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VirtualMachineDiskClient) Delete(container *VirtualMachineDisk) error { - return c.rancherClient.doResourceDelete(VIRTUAL_MACHINE_DISK_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume.go deleted file mode 100644 index 00b4e5d..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_volume.go +++ /dev/null @@ -1,230 +0,0 @@ -package client - -const ( - VOLUME_TYPE = "volume" -) - -type Volume struct { - Resource - - AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - DriverOpts map[string]interface{} `json:"driverOpts,omitempty" yaml:"driver_opts,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - ImageId string `json:"imageId,omitempty" yaml:"image_id,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - IsHostPath bool `json:"isHostPath,omitempty" yaml:"is_host_path,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SizeMb int64 `json:"sizeMb,omitempty" yaml:"size_mb,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StorageDriverId string `json:"storageDriverId,omitempty" yaml:"storage_driver_id,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeTemplateId string `json:"volumeTemplateId,omitempty" yaml:"volume_template_id,omitempty"` -} - -type VolumeCollection struct { - Collection - Data []Volume `json:"data,omitempty"` - client *VolumeClient -} - -type VolumeClient struct { - rancherClient *RancherClient -} - -type VolumeOperations interface { - List(opts *ListOpts) (*VolumeCollection, error) - Create(opts *Volume) (*Volume, error) - Update(existing *Volume, updates interface{}) (*Volume, error) - ById(id string) (*Volume, error) - Delete(container *Volume) error - - ActionAllocate(*Volume) (*Volume, error) - - ActionCreate(*Volume) (*Volume, error) - - ActionDeallocate(*Volume) (*Volume, error) - - ActionPurge(*Volume) (*Volume, error) - - ActionRemove(*Volume) (*Volume, error) - - ActionRestorefrombackup(*Volume, *RestoreFromBackupInput) (*Volume, error) - - ActionReverttosnapshot(*Volume, *RevertToSnapshotInput) (*Volume, error) - - ActionSnapshot(*Volume, *VolumeSnapshotInput) (*Snapshot, error) - - ActionUpdate(*Volume) (*Volume, error) -} - -func newVolumeClient(rancherClient *RancherClient) *VolumeClient { - return &VolumeClient{ - rancherClient: rancherClient, - } -} - -func (c *VolumeClient) Create(container *Volume) (*Volume, error) { - resp := &Volume{} - err := c.rancherClient.doCreate(VOLUME_TYPE, container, resp) - return resp, err -} - -func (c *VolumeClient) Update(existing *Volume, updates interface{}) (*Volume, error) { - resp := &Volume{} - err := c.rancherClient.doUpdate(VOLUME_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VolumeClient) List(opts *ListOpts) (*VolumeCollection, error) { - resp := &VolumeCollection{} - err := c.rancherClient.doList(VOLUME_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *VolumeCollection) Next() (*VolumeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &VolumeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *VolumeClient) ById(id string) (*Volume, error) { - resp := &Volume{} - err := c.rancherClient.doById(VOLUME_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VolumeClient) Delete(container *Volume) error { - return c.rancherClient.doResourceDelete(VOLUME_TYPE, &container.Resource) -} - -func (c *VolumeClient) ActionAllocate(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "allocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeClient) ActionCreate(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeClient) ActionDeallocate(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "deallocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeClient) ActionPurge(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeClient) ActionRemove(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeClient) ActionRestorefrombackup(resource *Volume, input *RestoreFromBackupInput) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "restorefrombackup", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VolumeClient) ActionReverttosnapshot(resource *Volume, input *RevertToSnapshotInput) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "reverttosnapshot", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VolumeClient) ActionSnapshot(resource *Volume, input *VolumeSnapshotInput) (*Snapshot, error) { - - resp := &Snapshot{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "snapshot", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VolumeClient) ActionUpdate(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go deleted file mode 100644 index be4269a..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - VOLUME_ACTIVATE_INPUT_TYPE = "volumeActivateInput" -) - -type VolumeActivateInput struct { - Resource - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` -} - -type VolumeActivateInputCollection struct { - Collection - Data []VolumeActivateInput `json:"data,omitempty"` - client *VolumeActivateInputClient -} - -type VolumeActivateInputClient struct { - rancherClient *RancherClient -} - -type VolumeActivateInputOperations interface { - List(opts *ListOpts) (*VolumeActivateInputCollection, error) - Create(opts *VolumeActivateInput) (*VolumeActivateInput, error) - Update(existing *VolumeActivateInput, updates interface{}) (*VolumeActivateInput, error) - ById(id string) (*VolumeActivateInput, error) - Delete(container *VolumeActivateInput) error -} - -func newVolumeActivateInputClient(rancherClient *RancherClient) *VolumeActivateInputClient { - return &VolumeActivateInputClient{ - rancherClient: rancherClient, - } -} - -func (c *VolumeActivateInputClient) Create(container *VolumeActivateInput) (*VolumeActivateInput, error) { - resp := &VolumeActivateInput{} - err := c.rancherClient.doCreate(VOLUME_ACTIVATE_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *VolumeActivateInputClient) Update(existing *VolumeActivateInput, updates interface{}) (*VolumeActivateInput, error) { - resp := &VolumeActivateInput{} - err := c.rancherClient.doUpdate(VOLUME_ACTIVATE_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VolumeActivateInputClient) List(opts *ListOpts) (*VolumeActivateInputCollection, error) { - resp := &VolumeActivateInputCollection{} - err := c.rancherClient.doList(VOLUME_ACTIVATE_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *VolumeActivateInputCollection) Next() (*VolumeActivateInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &VolumeActivateInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *VolumeActivateInputClient) ById(id string) (*VolumeActivateInput, error) { - resp := &VolumeActivateInput{} - err := c.rancherClient.doById(VOLUME_ACTIVATE_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VolumeActivateInputClient) Delete(container *VolumeActivateInput) error { - return c.rancherClient.doResourceDelete(VOLUME_ACTIVATE_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go deleted file mode 100644 index 2e2425a..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - VOLUME_SNAPSHOT_INPUT_TYPE = "volumeSnapshotInput" -) - -type VolumeSnapshotInput struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} - -type VolumeSnapshotInputCollection struct { - Collection - Data []VolumeSnapshotInput `json:"data,omitempty"` - client *VolumeSnapshotInputClient -} - -type VolumeSnapshotInputClient struct { - rancherClient *RancherClient -} - -type VolumeSnapshotInputOperations interface { - List(opts *ListOpts) (*VolumeSnapshotInputCollection, error) - Create(opts *VolumeSnapshotInput) (*VolumeSnapshotInput, error) - Update(existing *VolumeSnapshotInput, updates interface{}) (*VolumeSnapshotInput, error) - ById(id string) (*VolumeSnapshotInput, error) - Delete(container *VolumeSnapshotInput) error -} - -func newVolumeSnapshotInputClient(rancherClient *RancherClient) *VolumeSnapshotInputClient { - return &VolumeSnapshotInputClient{ - rancherClient: rancherClient, - } -} - -func (c *VolumeSnapshotInputClient) Create(container *VolumeSnapshotInput) (*VolumeSnapshotInput, error) { - resp := &VolumeSnapshotInput{} - err := c.rancherClient.doCreate(VOLUME_SNAPSHOT_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *VolumeSnapshotInputClient) Update(existing *VolumeSnapshotInput, updates interface{}) (*VolumeSnapshotInput, error) { - resp := &VolumeSnapshotInput{} - err := c.rancherClient.doUpdate(VOLUME_SNAPSHOT_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VolumeSnapshotInputClient) List(opts *ListOpts) (*VolumeSnapshotInputCollection, error) { - resp := &VolumeSnapshotInputCollection{} - err := c.rancherClient.doList(VOLUME_SNAPSHOT_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *VolumeSnapshotInputCollection) Next() (*VolumeSnapshotInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &VolumeSnapshotInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *VolumeSnapshotInputClient) ById(id string) (*VolumeSnapshotInput, error) { - resp := &VolumeSnapshotInput{} - err := c.rancherClient.doById(VOLUME_SNAPSHOT_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VolumeSnapshotInputClient) Delete(container *VolumeSnapshotInput) error { - return c.rancherClient.doResourceDelete(VOLUME_SNAPSHOT_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go deleted file mode 100644 index a747912..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go +++ /dev/null @@ -1,179 +0,0 @@ -package client - -const ( - VOLUME_TEMPLATE_TYPE = "volumeTemplate" -) - -type VolumeTemplate struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - DriverOpts map[string]interface{} `json:"driverOpts,omitempty" yaml:"driver_opts,omitempty"` - - External bool `json:"external,omitempty" yaml:"external,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PerContainer bool `json:"perContainer,omitempty" yaml:"per_container,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type VolumeTemplateCollection struct { - Collection - Data []VolumeTemplate `json:"data,omitempty"` - client *VolumeTemplateClient -} - -type VolumeTemplateClient struct { - rancherClient *RancherClient -} - -type VolumeTemplateOperations interface { - List(opts *ListOpts) (*VolumeTemplateCollection, error) - Create(opts *VolumeTemplate) (*VolumeTemplate, error) - Update(existing *VolumeTemplate, updates interface{}) (*VolumeTemplate, error) - ById(id string) (*VolumeTemplate, error) - Delete(container *VolumeTemplate) error - - ActionActivate(*VolumeTemplate) (*VolumeTemplate, error) - - ActionCreate(*VolumeTemplate) (*VolumeTemplate, error) - - ActionDeactivate(*VolumeTemplate) (*VolumeTemplate, error) - - ActionPurge(*VolumeTemplate) (*VolumeTemplate, error) - - ActionRemove(*VolumeTemplate) (*VolumeTemplate, error) - - ActionUpdate(*VolumeTemplate) (*VolumeTemplate, error) -} - -func newVolumeTemplateClient(rancherClient *RancherClient) *VolumeTemplateClient { - return &VolumeTemplateClient{ - rancherClient: rancherClient, - } -} - -func (c *VolumeTemplateClient) Create(container *VolumeTemplate) (*VolumeTemplate, error) { - resp := &VolumeTemplate{} - err := c.rancherClient.doCreate(VOLUME_TEMPLATE_TYPE, container, resp) - return resp, err -} - -func (c *VolumeTemplateClient) Update(existing *VolumeTemplate, updates interface{}) (*VolumeTemplate, error) { - resp := &VolumeTemplate{} - err := c.rancherClient.doUpdate(VOLUME_TEMPLATE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VolumeTemplateClient) List(opts *ListOpts) (*VolumeTemplateCollection, error) { - resp := &VolumeTemplateCollection{} - err := c.rancherClient.doList(VOLUME_TEMPLATE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *VolumeTemplateCollection) Next() (*VolumeTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &VolumeTemplateCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *VolumeTemplateClient) ById(id string) (*VolumeTemplate, error) { - resp := &VolumeTemplate{} - err := c.rancherClient.doById(VOLUME_TEMPLATE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VolumeTemplateClient) Delete(container *VolumeTemplate) error { - return c.rancherClient.doResourceDelete(VOLUME_TEMPLATE_TYPE, &container.Resource) -} - -func (c *VolumeTemplateClient) ActionActivate(resource *VolumeTemplate) (*VolumeTemplate, error) { - - resp := &VolumeTemplate{} - - err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeTemplateClient) ActionCreate(resource *VolumeTemplate) (*VolumeTemplate, error) { - - resp := &VolumeTemplate{} - - err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeTemplateClient) ActionDeactivate(resource *VolumeTemplate) (*VolumeTemplate, error) { - - resp := &VolumeTemplate{} - - err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeTemplateClient) ActionPurge(resource *VolumeTemplate) (*VolumeTemplate, error) { - - resp := &VolumeTemplate{} - - err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeTemplateClient) ActionRemove(resource *VolumeTemplate) (*VolumeTemplate, error) { - - resp := &VolumeTemplate{} - - err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeTemplateClient) ActionUpdate(resource *VolumeTemplate) (*VolumeTemplate, error) { - - resp := &VolumeTemplate{} - - err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/schemas.go b/vendor/github.com/rancher/go-rancher/v2/schemas.go deleted file mode 100644 index bcb6a7e..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/schemas.go +++ /dev/null @@ -1,131 +0,0 @@ -package client - -import ( - "reflect" - "strings" -) - -type Schemas struct { - Collection - Data []Schema `json:"data,omitempty"` - schemasByName map[string]*Schema -} - -func (s *Schema) CheckField(name string) (Field, bool) { - for fieldName := range s.ResourceFields { - if fieldName == name { - v, ok := s.ResourceFields[fieldName] - return v, ok - } - } - return Field{}, false -} - -func (s *Schema) Field(name string) Field { - f, _ := s.CheckField(name) - return f -} - -func (s *Schemas) CheckSchema(name string) (Schema, bool) { - for i := range s.Data { - if s.Data[i].Id == name { - return s.Data[i], true - } - } - return Schema{}, false -} - -func (s *Schemas) Schema(name string) Schema { - r, _ := s.CheckSchema(name) - return r -} - -func typeToFields(t reflect.Type) map[string]Field { - result := map[string]Field{} - - for i := 0; i < t.NumField(); i++ { - schemaField := Field{} - - typeField := t.Field(i) - if typeField.Anonymous && typeField.Type.Kind() == reflect.Struct { - parentFields := typeToFields(typeField.Type) - for k, v := range result { - parentFields[k] = v - } - result = parentFields - continue - } else if typeField.Anonymous { - continue - } else if privateFieldRegex.FindStringIndex(typeField.Name) != nil { - continue - } - - fieldString := strings.ToLower(typeField.Type.Kind().String()) - - switch { - case strings.HasPrefix(fieldString, "int") || strings.HasPrefix(fieldString, "uint"): - schemaField.Type = "int" - case fieldString == "bool": - schemaField.Type = fieldString - case fieldString == "float32" || fieldString == "float64": - schemaField.Type = "float" - case fieldString == "string": - schemaField.Type = "string" - case fieldString == "map": - // HACK - schemaField.Type = "map[string]" - case fieldString == "slice": - // HACK - schemaField.Type = "array[string]" - } - - name := strings.Split(typeField.Tag.Get("json"), ",")[0] - if name == "" && len(typeField.Name) > 1 { - name = strings.ToLower(typeField.Name[0:1]) + typeField.Name[1:] - } else if name == "" { - name = typeField.Name - } - - if schemaField.Type != "" { - result[name] = schemaField - } - } - - return result -} - -func (s *Schemas) AddType(schemaName string, obj interface{}) *Schema { - t := reflect.TypeOf(obj) - schema := Schema{ - Resource: Resource{ - Id: schemaName, - Type: "schema", - Links: map[string]string{}, - }, - PluralName: guessPluralName(schemaName), - ResourceFields: typeToFields(t), - CollectionMethods: []string{"GET"}, - ResourceMethods: []string{"GET"}, - } - - if s.Data == nil { - s.Data = []Schema{} - } - - s.Data = append(s.Data, schema) - - return &s.Data[len(s.Data)-1] -} - -func guessPluralName(name string) string { - if name == "" { - return "" - } - - if strings.HasSuffix(name, "s") || - strings.HasSuffix(name, "ch") || - strings.HasSuffix(name, "x") { - return name + "es" - } - return name + "s" -} diff --git a/vendor/github.com/rancher/go-rancher/v2/types.go b/vendor/github.com/rancher/go-rancher/v2/types.go deleted file mode 100644 index 905df87..0000000 --- a/vendor/github.com/rancher/go-rancher/v2/types.go +++ /dev/null @@ -1,95 +0,0 @@ -package client - -type Collection struct { - Type string `json:"type,omitempty"` - ResourceType string `json:"resourceType,omitempty"` - Links map[string]string `json:"links,omitempty"` - CreateTypes map[string]string `json:"createTypes,omitempty"` - Actions map[string]string `json:"actions,omitempty"` - SortLinks map[string]string `json:"sortLinks,omitempty"` - Pagination *Pagination `json:"pagination,omitempty"` - Sort *Sort `json:"sort,omitempty"` - Filters map[string][]Condition `json:"filters,omitempty"` -} - -type GenericCollection struct { - Collection - Data []interface{} `json:"data,omitempty"` -} - -type ResourceCollection struct { - Collection - Data []Resource `json:"data,omitempty"` -} - -type Sort struct { - Name string `json:"name,omitempty"` - Order string `json:"order,omitempty"` - Reverse string `json:"reverse,omitempty"` -} - -type Condition struct { - Modifier string `json:"modifier,omitempty"` - Value interface{} `json:"value,omitempty"` -} - -type Pagination struct { - Marker string `json:"marker,omitempty"` - First string `json:"first,omitempty"` - Previous string `json:"previous,omitempty"` - Next string `json:"next,omitempty"` - Limit *int64 `json:"limit,omitempty"` - Total *int64 `json:"total,omitempty"` - Partial bool `json:"partial,omitempty"` -} - -type Resource struct { - Id string `json:"id,omitempty"` - Type string `json:"type,omitempty"` - Links map[string]string `json:"links"` - Actions map[string]string `json:"actions"` -} - -type Schema struct { - Resource - PluralName string `json:"pluralName,omitempty"` - ResourceMethods []string `json:"resourceMethods,omitempty"` - ResourceFields map[string]Field `json:"resourceFields,omitempty"` - ResourceActions map[string]Action `json:"resourceActions,omitempty"` - CollectionMethods []string `json:"collectionMethods,omitempty"` - CollectionFields map[string]Field `json:"collectionFields,omitempty"` - CollectionActions map[string]Action `json:"collectionActions,omitempty"` - CollectionFilters map[string]Filter `json:"collectionFilters,omitempty"` - IncludeableLinks []string `json:"includeableLinks,omitempty"` -} - -type Field struct { - Type string `json:"type,omitempty"` - Default interface{} `json:"default,omitempty"` - Unique bool `json:"unique,omitempty"` - Nullable bool `json:"nullable,omitempty"` - Create bool `json:"create,omitempty"` - Required bool `json:"required,omitempty"` - Update bool `json:"update,omitempty"` - MinLength *int64 `json:"minLength,omitempty"` - MaxLength *int64 `json:"maxLength,omitempty"` - Min *int64 `json:"min,omitempty"` - Max *int64 `json:"max,omitempty"` - Options []string `json:"options,omitempty"` - ValidChars string `json:"validChars,omitempty"` - InvalidChars string `json:"invalidChars,omitempty"` - Description string `json:"description,omitempty"` -} - -type Action struct { - Input string `json:"input,omitempty"` - Output string `json:"output,omitempty"` -} - -type Filter struct { - Modifiers []string `json:"modifiers,omitempty"` -} - -type ListOpts struct { - Filters map[string]interface{} -} diff --git a/vendor/github.com/urfave/cli/CHANGELOG.md b/vendor/github.com/urfave/cli/CHANGELOG.md deleted file mode 100644 index 07f7546..0000000 --- a/vendor/github.com/urfave/cli/CHANGELOG.md +++ /dev/null @@ -1,392 +0,0 @@ -# Change Log - -**ATTN**: This project uses [semantic versioning](http://semver.org/). - -## [Unreleased] - -## [1.19.1] - 2016-11-21 - -### Fixed - -- Fixes regression introduced in 1.19.0 where using an `ActionFunc` as - the `Action` for a command would cause it to error rather than calling the - function. Should not have a affected declarative cases using `func(c - *cli.Context) err)`. -- Shell completion now handles the case where the user specifies - `--generate-bash-completion` immediately after a flag that takes an argument. - Previously it call the application with `--generate-bash-completion` as the - flag value. - -## [1.19.0] - 2016-11-19 -### Added -- `FlagsByName` was added to make it easy to sort flags (e.g. `sort.Sort(cli.FlagsByName(app.Flags))`) -- A `Description` field was added to `App` for a more detailed description of - the application (similar to the existing `Description` field on `Command`) -- Flag type code generation via `go generate` -- Write to stderr and exit 1 if action returns non-nil error -- Added support for TOML to the `altsrc` loader -- `SkipArgReorder` was added to allow users to skip the argument reordering. - This is useful if you want to consider all "flags" after an argument as - arguments rather than flags (the default behavior of the stdlib `flag` - library). This is backported functionality from the [removal of the flag - reordering](https://github.com/urfave/cli/pull/398) in the unreleased version - 2 -- For formatted errors (those implementing `ErrorFormatter`), the errors will - be formatted during output. Compatible with `pkg/errors`. - -### Changed -- Raise minimum tested/supported Go version to 1.2+ - -### Fixed -- Consider empty environment variables as set (previously environment variables - with the equivalent of `""` would be skipped rather than their value used). -- Return an error if the value in a given environment variable cannot be parsed - as the flag type. Previously these errors were silently swallowed. -- Print full error when an invalid flag is specified (which includes the invalid flag) -- `App.Writer` defaults to `stdout` when `nil` -- If no action is specified on a command or app, the help is now printed instead of `panic`ing -- `App.Metadata` is initialized automatically now (previously was `nil` unless initialized) -- Correctly show help message if `-h` is provided to a subcommand -- `context.(Global)IsSet` now respects environment variables. Previously it - would return `false` if a flag was specified in the environment rather than - as an argument -- Removed deprecation warnings to STDERR to avoid them leaking to the end-user -- `altsrc`s import paths were updated to use `gopkg.in/urfave/cli.v1`. This - fixes issues that occurred when `gopkg.in/urfave/cli.v1` was imported as well - as `altsrc` where Go would complain that the types didn't match - -## [1.18.1] - 2016-08-28 -### Fixed -- Removed deprecation warnings to STDERR to avoid them leaking to the end-user (backported) - -## [1.18.0] - 2016-06-27 -### Added -- `./runtests` test runner with coverage tracking by default -- testing on OS X -- testing on Windows -- `UintFlag`, `Uint64Flag`, and `Int64Flag` types and supporting code - -### Changed -- Use spaces for alignment in help/usage output instead of tabs, making the - output alignment consistent regardless of tab width - -### Fixed -- Printing of command aliases in help text -- Printing of visible flags for both struct and struct pointer flags -- Display the `help` subcommand when using `CommandCategories` -- No longer swallows `panic`s that occur within the `Action`s themselves when - detecting the signature of the `Action` field - -## [1.17.1] - 2016-08-28 -### Fixed -- Removed deprecation warnings to STDERR to avoid them leaking to the end-user - -## [1.17.0] - 2016-05-09 -### Added -- Pluggable flag-level help text rendering via `cli.DefaultFlagStringFunc` -- `context.GlobalBoolT` was added as an analogue to `context.GlobalBool` -- Support for hiding commands by setting `Hidden: true` -- this will hide the - commands in help output - -### Changed -- `Float64Flag`, `IntFlag`, and `DurationFlag` default values are no longer - quoted in help text output. -- All flag types now include `(default: {value})` strings following usage when a - default value can be (reasonably) detected. -- `IntSliceFlag` and `StringSliceFlag` usage strings are now more consistent - with non-slice flag types -- Apps now exit with a code of 3 if an unknown subcommand is specified - (previously they printed "No help topic for...", but still exited 0. This - makes it easier to script around apps built using `cli` since they can trust - that a 0 exit code indicated a successful execution. -- cleanups based on [Go Report Card - feedback](https://goreportcard.com/report/github.com/urfave/cli) - -## [1.16.1] - 2016-08-28 -### Fixed -- Removed deprecation warnings to STDERR to avoid them leaking to the end-user - -## [1.16.0] - 2016-05-02 -### Added -- `Hidden` field on all flag struct types to omit from generated help text - -### Changed -- `BashCompletionFlag` (`--enable-bash-completion`) is now omitted from -generated help text via the `Hidden` field - -### Fixed -- handling of error values in `HandleAction` and `HandleExitCoder` - -## [1.15.0] - 2016-04-30 -### Added -- This file! -- Support for placeholders in flag usage strings -- `App.Metadata` map for arbitrary data/state management -- `Set` and `GlobalSet` methods on `*cli.Context` for altering values after -parsing. -- Support for nested lookup of dot-delimited keys in structures loaded from -YAML. - -### Changed -- The `App.Action` and `Command.Action` now prefer a return signature of -`func(*cli.Context) error`, as defined by `cli.ActionFunc`. If a non-nil -`error` is returned, there may be two outcomes: - - If the error fulfills `cli.ExitCoder`, then `os.Exit` will be called - automatically - - Else the error is bubbled up and returned from `App.Run` -- Specifying an `Action` with the legacy return signature of -`func(*cli.Context)` will produce a deprecation message to stderr -- Specifying an `Action` that is not a `func` type will produce a non-zero exit -from `App.Run` -- Specifying an `Action` func that has an invalid (input) signature will -produce a non-zero exit from `App.Run` - -### Deprecated -- -`cli.App.RunAndExitOnError`, which should now be done by returning an error -that fulfills `cli.ExitCoder` to `cli.App.Run`. -- the legacy signature for -`cli.App.Action` of `func(*cli.Context)`, which should now have a return -signature of `func(*cli.Context) error`, as defined by `cli.ActionFunc`. - -### Fixed -- Added missing `*cli.Context.GlobalFloat64` method - -## [1.14.0] - 2016-04-03 (backfilled 2016-04-25) -### Added -- Codebeat badge -- Support for categorization via `CategorizedHelp` and `Categories` on app. - -### Changed -- Use `filepath.Base` instead of `path.Base` in `Name` and `HelpName`. - -### Fixed -- Ensure version is not shown in help text when `HideVersion` set. - -## [1.13.0] - 2016-03-06 (backfilled 2016-04-25) -### Added -- YAML file input support. -- `NArg` method on context. - -## [1.12.0] - 2016-02-17 (backfilled 2016-04-25) -### Added -- Custom usage error handling. -- Custom text support in `USAGE` section of help output. -- Improved help messages for empty strings. -- AppVeyor CI configuration. - -### Changed -- Removed `panic` from default help printer func. -- De-duping and optimizations. - -### Fixed -- Correctly handle `Before`/`After` at command level when no subcommands. -- Case of literal `-` argument causing flag reordering. -- Environment variable hints on Windows. -- Docs updates. - -## [1.11.1] - 2015-12-21 (backfilled 2016-04-25) -### Changed -- Use `path.Base` in `Name` and `HelpName` -- Export `GetName` on flag types. - -### Fixed -- Flag parsing when skipping is enabled. -- Test output cleanup. -- Move completion check to account for empty input case. - -## [1.11.0] - 2015-11-15 (backfilled 2016-04-25) -### Added -- Destination scan support for flags. -- Testing against `tip` in Travis CI config. - -### Changed -- Go version in Travis CI config. - -### Fixed -- Removed redundant tests. -- Use correct example naming in tests. - -## [1.10.2] - 2015-10-29 (backfilled 2016-04-25) -### Fixed -- Remove unused var in bash completion. - -## [1.10.1] - 2015-10-21 (backfilled 2016-04-25) -### Added -- Coverage and reference logos in README. - -### Fixed -- Use specified values in help and version parsing. -- Only display app version and help message once. - -## [1.10.0] - 2015-10-06 (backfilled 2016-04-25) -### Added -- More tests for existing functionality. -- `ArgsUsage` at app and command level for help text flexibility. - -### Fixed -- Honor `HideHelp` and `HideVersion` in `App.Run`. -- Remove juvenile word from README. - -## [1.9.0] - 2015-09-08 (backfilled 2016-04-25) -### Added -- `FullName` on command with accompanying help output update. -- Set default `$PROG` in bash completion. - -### Changed -- Docs formatting. - -### Fixed -- Removed self-referential imports in tests. - -## [1.8.0] - 2015-06-30 (backfilled 2016-04-25) -### Added -- Support for `Copyright` at app level. -- `Parent` func at context level to walk up context lineage. - -### Fixed -- Global flag processing at top level. - -## [1.7.1] - 2015-06-11 (backfilled 2016-04-25) -### Added -- Aggregate errors from `Before`/`After` funcs. -- Doc comments on flag structs. -- Include non-global flags when checking version and help. -- Travis CI config updates. - -### Fixed -- Ensure slice type flags have non-nil values. -- Collect global flags from the full command hierarchy. -- Docs prose. - -## [1.7.0] - 2015-05-03 (backfilled 2016-04-25) -### Changed -- `HelpPrinter` signature includes output writer. - -### Fixed -- Specify go 1.1+ in docs. -- Set `Writer` when running command as app. - -## [1.6.0] - 2015-03-23 (backfilled 2016-04-25) -### Added -- Multiple author support. -- `NumFlags` at context level. -- `Aliases` at command level. - -### Deprecated -- `ShortName` at command level. - -### Fixed -- Subcommand help output. -- Backward compatible support for deprecated `Author` and `Email` fields. -- Docs regarding `Names`/`Aliases`. - -## [1.5.0] - 2015-02-20 (backfilled 2016-04-25) -### Added -- `After` hook func support at app and command level. - -### Fixed -- Use parsed context when running command as subcommand. -- Docs prose. - -## [1.4.1] - 2015-01-09 (backfilled 2016-04-25) -### Added -- Support for hiding `-h / --help` flags, but not `help` subcommand. -- Stop flag parsing after `--`. - -### Fixed -- Help text for generic flags to specify single value. -- Use double quotes in output for defaults. -- Use `ParseInt` instead of `ParseUint` for int environment var values. -- Use `0` as base when parsing int environment var values. - -## [1.4.0] - 2014-12-12 (backfilled 2016-04-25) -### Added -- Support for environment variable lookup "cascade". -- Support for `Stdout` on app for output redirection. - -### Fixed -- Print command help instead of app help in `ShowCommandHelp`. - -## [1.3.1] - 2014-11-13 (backfilled 2016-04-25) -### Added -- Docs and example code updates. - -### Changed -- Default `-v / --version` flag made optional. - -## [1.3.0] - 2014-08-10 (backfilled 2016-04-25) -### Added -- `FlagNames` at context level. -- Exposed `VersionPrinter` var for more control over version output. -- Zsh completion hook. -- `AUTHOR` section in default app help template. -- Contribution guidelines. -- `DurationFlag` type. - -## [1.2.0] - 2014-08-02 -### Added -- Support for environment variable defaults on flags plus tests. - -## [1.1.0] - 2014-07-15 -### Added -- Bash completion. -- Optional hiding of built-in help command. -- Optional skipping of flag parsing at command level. -- `Author`, `Email`, and `Compiled` metadata on app. -- `Before` hook func support at app and command level. -- `CommandNotFound` func support at app level. -- Command reference available on context. -- `GenericFlag` type. -- `Float64Flag` type. -- `BoolTFlag` type. -- `IsSet` flag helper on context. -- More flag lookup funcs at context level. -- More tests & docs. - -### Changed -- Help template updates to account for presence/absence of flags. -- Separated subcommand help template. -- Exposed `HelpPrinter` var for more control over help output. - -## [1.0.0] - 2013-11-01 -### Added -- `help` flag in default app flag set and each command flag set. -- Custom handling of argument parsing errors. -- Command lookup by name at app level. -- `StringSliceFlag` type and supporting `StringSlice` type. -- `IntSliceFlag` type and supporting `IntSlice` type. -- Slice type flag lookups by name at context level. -- Export of app and command help functions. -- More tests & docs. - -## 0.1.0 - 2013-07-22 -### Added -- Initial implementation. - -[Unreleased]: https://github.com/urfave/cli/compare/v1.18.0...HEAD -[1.18.0]: https://github.com/urfave/cli/compare/v1.17.0...v1.18.0 -[1.17.0]: https://github.com/urfave/cli/compare/v1.16.0...v1.17.0 -[1.16.0]: https://github.com/urfave/cli/compare/v1.15.0...v1.16.0 -[1.15.0]: https://github.com/urfave/cli/compare/v1.14.0...v1.15.0 -[1.14.0]: https://github.com/urfave/cli/compare/v1.13.0...v1.14.0 -[1.13.0]: https://github.com/urfave/cli/compare/v1.12.0...v1.13.0 -[1.12.0]: https://github.com/urfave/cli/compare/v1.11.1...v1.12.0 -[1.11.1]: https://github.com/urfave/cli/compare/v1.11.0...v1.11.1 -[1.11.0]: https://github.com/urfave/cli/compare/v1.10.2...v1.11.0 -[1.10.2]: https://github.com/urfave/cli/compare/v1.10.1...v1.10.2 -[1.10.1]: https://github.com/urfave/cli/compare/v1.10.0...v1.10.1 -[1.10.0]: https://github.com/urfave/cli/compare/v1.9.0...v1.10.0 -[1.9.0]: https://github.com/urfave/cli/compare/v1.8.0...v1.9.0 -[1.8.0]: https://github.com/urfave/cli/compare/v1.7.1...v1.8.0 -[1.7.1]: https://github.com/urfave/cli/compare/v1.7.0...v1.7.1 -[1.7.0]: https://github.com/urfave/cli/compare/v1.6.0...v1.7.0 -[1.6.0]: https://github.com/urfave/cli/compare/v1.5.0...v1.6.0 -[1.5.0]: https://github.com/urfave/cli/compare/v1.4.1...v1.5.0 -[1.4.1]: https://github.com/urfave/cli/compare/v1.4.0...v1.4.1 -[1.4.0]: https://github.com/urfave/cli/compare/v1.3.1...v1.4.0 -[1.3.1]: https://github.com/urfave/cli/compare/v1.3.0...v1.3.1 -[1.3.0]: https://github.com/urfave/cli/compare/v1.2.0...v1.3.0 -[1.2.0]: https://github.com/urfave/cli/compare/v1.1.0...v1.2.0 -[1.1.0]: https://github.com/urfave/cli/compare/v1.0.0...v1.1.0 -[1.0.0]: https://github.com/urfave/cli/compare/v0.1.0...v1.0.0 diff --git a/vendor/github.com/urfave/cli/LICENSE b/vendor/github.com/urfave/cli/LICENSE deleted file mode 100644 index 42a597e..0000000 --- a/vendor/github.com/urfave/cli/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Jeremy Saenz & Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/urfave/cli/README.md b/vendor/github.com/urfave/cli/README.md deleted file mode 100644 index 2bbbd8e..0000000 --- a/vendor/github.com/urfave/cli/README.md +++ /dev/null @@ -1,1381 +0,0 @@ -cli -=== - -[![Build Status](https://travis-ci.org/urfave/cli.svg?branch=master)](https://travis-ci.org/urfave/cli) -[![Windows Build Status](https://ci.appveyor.com/api/projects/status/rtgk5xufi932pb2v?svg=true)](https://ci.appveyor.com/project/urfave/cli) -[![GoDoc](https://godoc.org/github.com/urfave/cli?status.svg)](https://godoc.org/github.com/urfave/cli) -[![codebeat](https://codebeat.co/badges/0a8f30aa-f975-404b-b878-5fab3ae1cc5f)](https://codebeat.co/projects/github-com-urfave-cli) -[![Go Report Card](https://goreportcard.com/badge/urfave/cli)](https://goreportcard.com/report/urfave/cli) -[![top level coverage](https://gocover.io/_badge/github.com/urfave/cli?0 "top level coverage")](http://gocover.io/github.com/urfave/cli) / -[![altsrc coverage](https://gocover.io/_badge/github.com/urfave/cli/altsrc?0 "altsrc coverage")](http://gocover.io/github.com/urfave/cli/altsrc) - -**Notice:** This is the library formerly known as -`github.com/codegangsta/cli` -- Github will automatically redirect requests -to this repository, but we recommend updating your references for clarity. - -cli is a simple, fast, and fun package for building command line apps in Go. The -goal is to enable developers to write fast and distributable command line -applications in an expressive way. - - - -- [Overview](#overview) -- [Installation](#installation) - * [Supported platforms](#supported-platforms) - * [Using the `v2` branch](#using-the-v2-branch) - * [Pinning to the `v1` releases](#pinning-to-the-v1-releases) -- [Getting Started](#getting-started) -- [Examples](#examples) - * [Arguments](#arguments) - * [Flags](#flags) - + [Placeholder Values](#placeholder-values) - + [Alternate Names](#alternate-names) - + [Ordering](#ordering) - + [Values from the Environment](#values-from-the-environment) - + [Values from alternate input sources (YAML, TOML, and others)](#values-from-alternate-input-sources-yaml-toml-and-others) - * [Subcommands](#subcommands) - * [Subcommands categories](#subcommands-categories) - * [Exit code](#exit-code) - * [Bash Completion](#bash-completion) - + [Enabling](#enabling) - + [Distribution](#distribution) - + [Customization](#customization) - * [Generated Help Text](#generated-help-text) - + [Customization](#customization-1) - * [Version Flag](#version-flag) - + [Customization](#customization-2) - + [Full API Example](#full-api-example) -- [Contribution Guidelines](#contribution-guidelines) - - - -## Overview - -Command line apps are usually so tiny that there is absolutely no reason why -your code should *not* be self-documenting. Things like generating help text and -parsing command flags/options should not hinder productivity when writing a -command line app. - -**This is where cli comes into play.** cli makes command line programming fun, -organized, and expressive! - -## Installation - -Make sure you have a working Go environment. Go version 1.2+ is supported. [See -the install instructions for Go](http://golang.org/doc/install.html). - -To install cli, simply run: -``` -$ go get github.com/urfave/cli -``` - -Make sure your `PATH` includes the `$GOPATH/bin` directory so your commands can -be easily used: -``` -export PATH=$PATH:$GOPATH/bin -``` - -### Supported platforms - -cli is tested against multiple versions of Go on Linux, and against the latest -released version of Go on OS X and Windows. For full details, see -[`./.travis.yml`](./.travis.yml) and [`./appveyor.yml`](./appveyor.yml). - -### Using the `v2` branch - -**Warning**: The `v2` branch is currently unreleased and considered unstable. - -There is currently a long-lived branch named `v2` that is intended to land as -the new `master` branch once development there has settled down. The current -`master` branch (mirrored as `v1`) is being manually merged into `v2` on -an irregular human-based schedule, but generally if one wants to "upgrade" to -`v2` *now* and accept the volatility (read: "awesomeness") that comes along with -that, please use whatever version pinning of your preference, such as via -`gopkg.in`: - -``` -$ go get gopkg.in/urfave/cli.v2 -``` - -``` go -... -import ( - "gopkg.in/urfave/cli.v2" // imports as package "cli" -) -... -``` - -### Pinning to the `v1` releases - -Similarly to the section above describing use of the `v2` branch, if one wants -to avoid any unexpected compatibility pains once `v2` becomes `master`, then -pinning to `v1` is an acceptable option, e.g.: - -``` -$ go get gopkg.in/urfave/cli.v1 -``` - -``` go -... -import ( - "gopkg.in/urfave/cli.v1" // imports as package "cli" -) -... -``` - -This will pull the latest tagged `v1` release (e.g. `v1.18.1` at the time of writing). - -## Getting Started - -One of the philosophies behind cli is that an API should be playful and full of -discovery. So a cli app can be as little as one line of code in `main()`. - - -``` go -package main - -import ( - "os" - - "github.com/urfave/cli" -) - -func main() { - cli.NewApp().Run(os.Args) -} -``` - -This app will run and show help text, but is not very useful. Let's give an -action to execute and some help documentation: - - -``` go -package main - -import ( - "fmt" - "os" - - "github.com/urfave/cli" -) - -func main() { - app := cli.NewApp() - app.Name = "boom" - app.Usage = "make an explosive entrance" - app.Action = func(c *cli.Context) error { - fmt.Println("boom! I say!") - return nil - } - - app.Run(os.Args) -} -``` - -Running this already gives you a ton of functionality, plus support for things -like subcommands and flags, which are covered below. - -## Examples - -Being a programmer can be a lonely job. Thankfully by the power of automation -that is not the case! Let's create a greeter app to fend off our demons of -loneliness! - -Start by creating a directory named `greet`, and within it, add a file, -`greet.go` with the following code in it: - - -``` go -package main - -import ( - "fmt" - "os" - - "github.com/urfave/cli" -) - -func main() { - app := cli.NewApp() - app.Name = "greet" - app.Usage = "fight the loneliness!" - app.Action = func(c *cli.Context) error { - fmt.Println("Hello friend!") - return nil - } - - app.Run(os.Args) -} -``` - -Install our command to the `$GOPATH/bin` directory: - -``` -$ go install -``` - -Finally run our new command: - -``` -$ greet -Hello friend! -``` - -cli also generates neat help text: - -``` -$ greet help -NAME: - greet - fight the loneliness! - -USAGE: - greet [global options] command [command options] [arguments...] - -VERSION: - 0.0.0 - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS - --version Shows version information -``` - -### Arguments - -You can lookup arguments by calling the `Args` function on `cli.Context`, e.g.: - - -``` go -package main - -import ( - "fmt" - "os" - - "github.com/urfave/cli" -) - -func main() { - app := cli.NewApp() - - app.Action = func(c *cli.Context) error { - fmt.Printf("Hello %q", c.Args().Get(0)) - return nil - } - - app.Run(os.Args) -} -``` - -### Flags - -Setting and querying flags is simple. - - -``` go -package main - -import ( - "fmt" - "os" - - "github.com/urfave/cli" -) - -func main() { - app := cli.NewApp() - - app.Flags = []cli.Flag { - cli.StringFlag{ - Name: "lang", - Value: "english", - Usage: "language for the greeting", - }, - } - - app.Action = func(c *cli.Context) error { - name := "Nefertiti" - if c.NArg() > 0 { - name = c.Args().Get(0) - } - if c.String("lang") == "spanish" { - fmt.Println("Hola", name) - } else { - fmt.Println("Hello", name) - } - return nil - } - - app.Run(os.Args) -} -``` - -You can also set a destination variable for a flag, to which the content will be -scanned. - - -``` go -package main - -import ( - "os" - "fmt" - - "github.com/urfave/cli" -) - -func main() { - var language string - - app := cli.NewApp() - - app.Flags = []cli.Flag { - cli.StringFlag{ - Name: "lang", - Value: "english", - Usage: "language for the greeting", - Destination: &language, - }, - } - - app.Action = func(c *cli.Context) error { - name := "someone" - if c.NArg() > 0 { - name = c.Args()[0] - } - if language == "spanish" { - fmt.Println("Hola", name) - } else { - fmt.Println("Hello", name) - } - return nil - } - - app.Run(os.Args) -} -``` - -See full list of flags at http://godoc.org/github.com/urfave/cli - -#### Placeholder Values - -Sometimes it's useful to specify a flag's value within the usage string itself. -Such placeholders are indicated with back quotes. - -For example this: - - -```go -package main - -import ( - "os" - - "github.com/urfave/cli" -) - -func main() { - app := cli.NewApp() - - app.Flags = []cli.Flag{ - cli.StringFlag{ - Name: "config, c", - Usage: "Load configuration from `FILE`", - }, - } - - app.Run(os.Args) -} -``` - -Will result in help output like: - -``` ---config FILE, -c FILE Load configuration from FILE -``` - -Note that only the first placeholder is used. Subsequent back-quoted words will -be left as-is. - -#### Alternate Names - -You can set alternate (or short) names for flags by providing a comma-delimited -list for the `Name`. e.g. - - -``` go -package main - -import ( - "os" - - "github.com/urfave/cli" -) - -func main() { - app := cli.NewApp() - - app.Flags = []cli.Flag { - cli.StringFlag{ - Name: "lang, l", - Value: "english", - Usage: "language for the greeting", - }, - } - - app.Run(os.Args) -} -``` - -That flag can then be set with `--lang spanish` or `-l spanish`. Note that -giving two different forms of the same flag in the same command invocation is an -error. - -#### Ordering - -Flags for the application and commands are shown in the order they are defined. -However, it's possible to sort them from outside this library by using `FlagsByName` -or `CommandsByName` with `sort`. - -For example this: - - -``` go -package main - -import ( - "os" - "sort" - - "github.com/urfave/cli" -) - -func main() { - app := cli.NewApp() - - app.Flags = []cli.Flag { - cli.StringFlag{ - Name: "lang, l", - Value: "english", - Usage: "Language for the greeting", - }, - cli.StringFlag{ - Name: "config, c", - Usage: "Load configuration from `FILE`", - }, - } - - app.Commands = []cli.Command{ - { - Name: "complete", - Aliases: []string{"c"}, - Usage: "complete a task on the list", - Action: func(c *cli.Context) error { - return nil - }, - }, - { - Name: "add", - Aliases: []string{"a"}, - Usage: "add a task to the list", - Action: func(c *cli.Context) error { - return nil - }, - }, - } - - sort.Sort(cli.FlagsByName(app.Flags)) - sort.Sort(cli.CommandsByName(app.Commands)) - - app.Run(os.Args) -} -``` - -Will result in help output like: - -``` ---config FILE, -c FILE Load configuration from FILE ---lang value, -l value Language for the greeting (default: "english") -``` - -#### Values from the Environment - -You can also have the default value set from the environment via `EnvVar`. e.g. - - -``` go -package main - -import ( - "os" - - "github.com/urfave/cli" -) - -func main() { - app := cli.NewApp() - - app.Flags = []cli.Flag { - cli.StringFlag{ - Name: "lang, l", - Value: "english", - Usage: "language for the greeting", - EnvVar: "APP_LANG", - }, - } - - app.Run(os.Args) -} -``` - -The `EnvVar` may also be given as a comma-delimited "cascade", where the first -environment variable that resolves is used as the default. - - -``` go -package main - -import ( - "os" - - "github.com/urfave/cli" -) - -func main() { - app := cli.NewApp() - - app.Flags = []cli.Flag { - cli.StringFlag{ - Name: "lang, l", - Value: "english", - Usage: "language for the greeting", - EnvVar: "LEGACY_COMPAT_LANG,APP_LANG,LANG", - }, - } - - app.Run(os.Args) -} -``` - -#### Values from alternate input sources (YAML, TOML, and others) - -There is a separate package altsrc that adds support for getting flag values -from other file input sources. - -Currently supported input source formats: -* YAML -* TOML - -In order to get values for a flag from an alternate input source the following -code would be added to wrap an existing cli.Flag like below: - -``` go - altsrc.NewIntFlag(cli.IntFlag{Name: "test"}) -``` - -Initialization must also occur for these flags. Below is an example initializing -getting data from a yaml file below. - -``` go - command.Before = altsrc.InitInputSourceWithContext(command.Flags, NewYamlSourceFromFlagFunc("load")) -``` - -The code above will use the "load" string as a flag name to get the file name of -a yaml file from the cli.Context. It will then use that file name to initialize -the yaml input source for any flags that are defined on that command. As a note -the "load" flag used would also have to be defined on the command flags in order -for this code snipped to work. - -Currently only the aboved specified formats are supported but developers can -add support for other input sources by implementing the -altsrc.InputSourceContext for their given sources. - -Here is a more complete sample of a command using YAML support: - - -``` go -package notmain - -import ( - "fmt" - "os" - - "github.com/urfave/cli" - "github.com/urfave/cli/altsrc" -) - -func main() { - app := cli.NewApp() - - flags := []cli.Flag{ - altsrc.NewIntFlag(cli.IntFlag{Name: "test"}), - cli.StringFlag{Name: "load"}, - } - - app.Action = func(c *cli.Context) error { - fmt.Println("yaml ist rad") - return nil - } - - app.Before = altsrc.InitInputSourceWithContext(flags, altsrc.NewYamlSourceFromFlagFunc("load")) - app.Flags = flags - - app.Run(os.Args) -} -``` - -### Subcommands - -Subcommands can be defined for a more git-like command line app. - - -```go -package main - -import ( - "fmt" - "os" - - "github.com/urfave/cli" -) - -func main() { - app := cli.NewApp() - - app.Commands = []cli.Command{ - { - Name: "add", - Aliases: []string{"a"}, - Usage: "add a task to the list", - Action: func(c *cli.Context) error { - fmt.Println("added task: ", c.Args().First()) - return nil - }, - }, - { - Name: "complete", - Aliases: []string{"c"}, - Usage: "complete a task on the list", - Action: func(c *cli.Context) error { - fmt.Println("completed task: ", c.Args().First()) - return nil - }, - }, - { - Name: "template", - Aliases: []string{"t"}, - Usage: "options for task templates", - Subcommands: []cli.Command{ - { - Name: "add", - Usage: "add a new template", - Action: func(c *cli.Context) error { - fmt.Println("new task template: ", c.Args().First()) - return nil - }, - }, - { - Name: "remove", - Usage: "remove an existing template", - Action: func(c *cli.Context) error { - fmt.Println("removed task template: ", c.Args().First()) - return nil - }, - }, - }, - }, - } - - app.Run(os.Args) -} -``` - -### Subcommands categories - -For additional organization in apps that have many subcommands, you can -associate a category for each command to group them together in the help -output. - -E.g. - -```go -package main - -import ( - "os" - - "github.com/urfave/cli" -) - -func main() { - app := cli.NewApp() - - app.Commands = []cli.Command{ - { - Name: "noop", - }, - { - Name: "add", - Category: "template", - }, - { - Name: "remove", - Category: "template", - }, - } - - app.Run(os.Args) -} -``` - -Will include: - -``` -COMMANDS: - noop - - Template actions: - add - remove -``` - -### Exit code - -Calling `App.Run` will not automatically call `os.Exit`, which means that by -default the exit code will "fall through" to being `0`. An explicit exit code -may be set by returning a non-nil error that fulfills `cli.ExitCoder`, *or* a -`cli.MultiError` that includes an error that fulfills `cli.ExitCoder`, e.g.: - -``` go -package main - -import ( - "os" - - "github.com/urfave/cli" -) - -func main() { - app := cli.NewApp() - app.Flags = []cli.Flag{ - cli.BoolTFlag{ - Name: "ginger-crouton", - Usage: "is it in the soup?", - }, - } - app.Action = func(ctx *cli.Context) error { - if !ctx.Bool("ginger-crouton") { - return cli.NewExitError("it is not in the soup", 86) - } - return nil - } - - app.Run(os.Args) -} -``` - -### Bash Completion - -You can enable completion commands by setting the `EnableBashCompletion` -flag on the `App` object. By default, this setting will only auto-complete to -show an app's subcommands, but you can write your own completion methods for -the App or its subcommands. - - -``` go -package main - -import ( - "fmt" - "os" - - "github.com/urfave/cli" -) - -func main() { - tasks := []string{"cook", "clean", "laundry", "eat", "sleep", "code"} - - app := cli.NewApp() - app.EnableBashCompletion = true - app.Commands = []cli.Command{ - { - Name: "complete", - Aliases: []string{"c"}, - Usage: "complete a task on the list", - Action: func(c *cli.Context) error { - fmt.Println("completed task: ", c.Args().First()) - return nil - }, - BashComplete: func(c *cli.Context) { - // This will complete if no args are passed - if c.NArg() > 0 { - return - } - for _, t := range tasks { - fmt.Println(t) - } - }, - }, - } - - app.Run(os.Args) -} -``` - -#### Enabling - -Source the `autocomplete/bash_autocomplete` file in your `.bashrc` file while -setting the `PROG` variable to the name of your program: - -`PROG=myprogram source /.../cli/autocomplete/bash_autocomplete` - -#### Distribution - -Copy `autocomplete/bash_autocomplete` into `/etc/bash_completion.d/` and rename -it to the name of the program you wish to add autocomplete support for (or -automatically install it there if you are distributing a package). Don't forget -to source the file to make it active in the current shell. - -``` -sudo cp src/bash_autocomplete /etc/bash_completion.d/ -source /etc/bash_completion.d/ -``` - -Alternatively, you can just document that users should source the generic -`autocomplete/bash_autocomplete` in their bash configuration with `$PROG` set -to the name of their program (as above). - -#### Customization - -The default bash completion flag (`--generate-bash-completion`) is defined as -`cli.BashCompletionFlag`, and may be redefined if desired, e.g.: - - -``` go -package main - -import ( - "os" - - "github.com/urfave/cli" -) - -func main() { - cli.BashCompletionFlag = cli.BoolFlag{ - Name: "compgen", - Hidden: true, - } - - app := cli.NewApp() - app.EnableBashCompletion = true - app.Commands = []cli.Command{ - { - Name: "wat", - }, - } - app.Run(os.Args) -} -``` - -### Generated Help Text - -The default help flag (`-h/--help`) is defined as `cli.HelpFlag` and is checked -by the cli internals in order to print generated help text for the app, command, -or subcommand, and break execution. - -#### Customization - -All of the help text generation may be customized, and at multiple levels. The -templates are exposed as variables `AppHelpTemplate`, `CommandHelpTemplate`, and -`SubcommandHelpTemplate` which may be reassigned or augmented, and full override -is possible by assigning a compatible func to the `cli.HelpPrinter` variable, -e.g.: - - -``` go -package main - -import ( - "fmt" - "io" - "os" - - "github.com/urfave/cli" -) - -func main() { - // EXAMPLE: Append to an existing template - cli.AppHelpTemplate = fmt.Sprintf(`%s - -WEBSITE: http://awesometown.example.com - -SUPPORT: support@awesometown.example.com - -`, cli.AppHelpTemplate) - - // EXAMPLE: Override a template - cli.AppHelpTemplate = `NAME: - {{.Name}} - {{.Usage}} -USAGE: - {{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}} - {{if len .Authors}} -AUTHOR: - {{range .Authors}}{{ . }}{{end}} - {{end}}{{if .Commands}} -COMMANDS: -{{range .Commands}}{{if not .HideHelp}} {{join .Names ", "}}{{ "\t"}}{{.Usage}}{{ "\n" }}{{end}}{{end}}{{end}}{{if .VisibleFlags}} -GLOBAL OPTIONS: - {{range .VisibleFlags}}{{.}} - {{end}}{{end}}{{if .Copyright }} -COPYRIGHT: - {{.Copyright}} - {{end}}{{if .Version}} -VERSION: - {{.Version}} - {{end}} -` - - // EXAMPLE: Replace the `HelpPrinter` func - cli.HelpPrinter = func(w io.Writer, templ string, data interface{}) { - fmt.Println("Ha HA. I pwnd the help!!1") - } - - cli.NewApp().Run(os.Args) -} -``` - -The default flag may be customized to something other than `-h/--help` by -setting `cli.HelpFlag`, e.g.: - - -``` go -package main - -import ( - "os" - - "github.com/urfave/cli" -) - -func main() { - cli.HelpFlag = cli.BoolFlag{ - Name: "halp, haaaaalp", - Usage: "HALP", - EnvVar: "SHOW_HALP,HALPPLZ", - } - - cli.NewApp().Run(os.Args) -} -``` - -### Version Flag - -The default version flag (`-v/--version`) is defined as `cli.VersionFlag`, which -is checked by the cli internals in order to print the `App.Version` via -`cli.VersionPrinter` and break execution. - -#### Customization - -The default flag may be customized to something other than `-v/--version` by -setting `cli.VersionFlag`, e.g.: - - -``` go -package main - -import ( - "os" - - "github.com/urfave/cli" -) - -func main() { - cli.VersionFlag = cli.BoolFlag{ - Name: "print-version, V", - Usage: "print only the version", - } - - app := cli.NewApp() - app.Name = "partay" - app.Version = "19.99.0" - app.Run(os.Args) -} -``` - -Alternatively, the version printer at `cli.VersionPrinter` may be overridden, e.g.: - - -``` go -package main - -import ( - "fmt" - "os" - - "github.com/urfave/cli" -) - -var ( - Revision = "fafafaf" -) - -func main() { - cli.VersionPrinter = func(c *cli.Context) { - fmt.Printf("version=%s revision=%s\n", c.App.Version, Revision) - } - - app := cli.NewApp() - app.Name = "partay" - app.Version = "19.99.0" - app.Run(os.Args) -} -``` - -#### Full API Example - -**Notice**: This is a contrived (functioning) example meant strictly for API -demonstration purposes. Use of one's imagination is encouraged. - - -``` go -package main - -import ( - "errors" - "flag" - "fmt" - "io" - "io/ioutil" - "os" - "time" - - "github.com/urfave/cli" -) - -func init() { - cli.AppHelpTemplate += "\nCUSTOMIZED: you bet ur muffins\n" - cli.CommandHelpTemplate += "\nYMMV\n" - cli.SubcommandHelpTemplate += "\nor something\n" - - cli.HelpFlag = cli.BoolFlag{Name: "halp"} - cli.BashCompletionFlag = cli.BoolFlag{Name: "compgen", Hidden: true} - cli.VersionFlag = cli.BoolFlag{Name: "print-version, V"} - - cli.HelpPrinter = func(w io.Writer, templ string, data interface{}) { - fmt.Fprintf(w, "best of luck to you\n") - } - cli.VersionPrinter = func(c *cli.Context) { - fmt.Fprintf(c.App.Writer, "version=%s\n", c.App.Version) - } - cli.OsExiter = func(c int) { - fmt.Fprintf(cli.ErrWriter, "refusing to exit %d\n", c) - } - cli.ErrWriter = ioutil.Discard - cli.FlagStringer = func(fl cli.Flag) string { - return fmt.Sprintf("\t\t%s", fl.GetName()) - } -} - -type hexWriter struct{} - -func (w *hexWriter) Write(p []byte) (int, error) { - for _, b := range p { - fmt.Printf("%x", b) - } - fmt.Printf("\n") - - return len(p), nil -} - -type genericType struct{ - s string -} - -func (g *genericType) Set(value string) error { - g.s = value - return nil -} - -func (g *genericType) String() string { - return g.s -} - -func main() { - app := cli.NewApp() - app.Name = "kənˈtrīv" - app.Version = "19.99.0" - app.Compiled = time.Now() - app.Authors = []cli.Author{ - cli.Author{ - Name: "Example Human", - Email: "human@example.com", - }, - } - app.Copyright = "(c) 1999 Serious Enterprise" - app.HelpName = "contrive" - app.Usage = "demonstrate available API" - app.UsageText = "contrive - demonstrating the available API" - app.ArgsUsage = "[args and such]" - app.Commands = []cli.Command{ - cli.Command{ - Name: "doo", - Aliases: []string{"do"}, - Category: "motion", - Usage: "do the doo", - UsageText: "doo - does the dooing", - Description: "no really, there is a lot of dooing to be done", - ArgsUsage: "[arrgh]", - Flags: []cli.Flag{ - cli.BoolFlag{Name: "forever, forevvarr"}, - }, - Subcommands: cli.Commands{ - cli.Command{ - Name: "wop", - Action: wopAction, - }, - }, - SkipFlagParsing: false, - HideHelp: false, - Hidden: false, - HelpName: "doo!", - BashComplete: func(c *cli.Context) { - fmt.Fprintf(c.App.Writer, "--better\n") - }, - Before: func(c *cli.Context) error { - fmt.Fprintf(c.App.Writer, "brace for impact\n") - return nil - }, - After: func(c *cli.Context) error { - fmt.Fprintf(c.App.Writer, "did we lose anyone?\n") - return nil - }, - Action: func(c *cli.Context) error { - c.Command.FullName() - c.Command.HasName("wop") - c.Command.Names() - c.Command.VisibleFlags() - fmt.Fprintf(c.App.Writer, "dodododododoodododddooooododododooo\n") - if c.Bool("forever") { - c.Command.Run(c) - } - return nil - }, - OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error { - fmt.Fprintf(c.App.Writer, "for shame\n") - return err - }, - }, - } - app.Flags = []cli.Flag{ - cli.BoolFlag{Name: "fancy"}, - cli.BoolTFlag{Name: "fancier"}, - cli.DurationFlag{Name: "howlong, H", Value: time.Second * 3}, - cli.Float64Flag{Name: "howmuch"}, - cli.GenericFlag{Name: "wat", Value: &genericType{}}, - cli.Int64Flag{Name: "longdistance"}, - cli.Int64SliceFlag{Name: "intervals"}, - cli.IntFlag{Name: "distance"}, - cli.IntSliceFlag{Name: "times"}, - cli.StringFlag{Name: "dance-move, d"}, - cli.StringSliceFlag{Name: "names, N"}, - cli.UintFlag{Name: "age"}, - cli.Uint64Flag{Name: "bigage"}, - } - app.EnableBashCompletion = true - app.HideHelp = false - app.HideVersion = false - app.BashComplete = func(c *cli.Context) { - fmt.Fprintf(c.App.Writer, "lipstick\nkiss\nme\nlipstick\nringo\n") - } - app.Before = func(c *cli.Context) error { - fmt.Fprintf(c.App.Writer, "HEEEERE GOES\n") - return nil - } - app.After = func(c *cli.Context) error { - fmt.Fprintf(c.App.Writer, "Phew!\n") - return nil - } - app.CommandNotFound = func(c *cli.Context, command string) { - fmt.Fprintf(c.App.Writer, "Thar be no %q here.\n", command) - } - app.OnUsageError = func(c *cli.Context, err error, isSubcommand bool) error { - if isSubcommand { - return err - } - - fmt.Fprintf(c.App.Writer, "WRONG: %#v\n", err) - return nil - } - app.Action = func(c *cli.Context) error { - cli.DefaultAppComplete(c) - cli.HandleExitCoder(errors.New("not an exit coder, though")) - cli.ShowAppHelp(c) - cli.ShowCommandCompletions(c, "nope") - cli.ShowCommandHelp(c, "also-nope") - cli.ShowCompletions(c) - cli.ShowSubcommandHelp(c) - cli.ShowVersion(c) - - categories := c.App.Categories() - categories.AddCommand("sounds", cli.Command{ - Name: "bloop", - }) - - for _, category := range c.App.Categories() { - fmt.Fprintf(c.App.Writer, "%s\n", category.Name) - fmt.Fprintf(c.App.Writer, "%#v\n", category.Commands) - fmt.Fprintf(c.App.Writer, "%#v\n", category.VisibleCommands()) - } - - fmt.Printf("%#v\n", c.App.Command("doo")) - if c.Bool("infinite") { - c.App.Run([]string{"app", "doo", "wop"}) - } - - if c.Bool("forevar") { - c.App.RunAsSubcommand(c) - } - c.App.Setup() - fmt.Printf("%#v\n", c.App.VisibleCategories()) - fmt.Printf("%#v\n", c.App.VisibleCommands()) - fmt.Printf("%#v\n", c.App.VisibleFlags()) - - fmt.Printf("%#v\n", c.Args().First()) - if len(c.Args()) > 0 { - fmt.Printf("%#v\n", c.Args()[1]) - } - fmt.Printf("%#v\n", c.Args().Present()) - fmt.Printf("%#v\n", c.Args().Tail()) - - set := flag.NewFlagSet("contrive", 0) - nc := cli.NewContext(c.App, set, c) - - fmt.Printf("%#v\n", nc.Args()) - fmt.Printf("%#v\n", nc.Bool("nope")) - fmt.Printf("%#v\n", nc.BoolT("nerp")) - fmt.Printf("%#v\n", nc.Duration("howlong")) - fmt.Printf("%#v\n", nc.Float64("hay")) - fmt.Printf("%#v\n", nc.Generic("bloop")) - fmt.Printf("%#v\n", nc.Int64("bonk")) - fmt.Printf("%#v\n", nc.Int64Slice("burnks")) - fmt.Printf("%#v\n", nc.Int("bips")) - fmt.Printf("%#v\n", nc.IntSlice("blups")) - fmt.Printf("%#v\n", nc.String("snurt")) - fmt.Printf("%#v\n", nc.StringSlice("snurkles")) - fmt.Printf("%#v\n", nc.Uint("flub")) - fmt.Printf("%#v\n", nc.Uint64("florb")) - fmt.Printf("%#v\n", nc.GlobalBool("global-nope")) - fmt.Printf("%#v\n", nc.GlobalBoolT("global-nerp")) - fmt.Printf("%#v\n", nc.GlobalDuration("global-howlong")) - fmt.Printf("%#v\n", nc.GlobalFloat64("global-hay")) - fmt.Printf("%#v\n", nc.GlobalGeneric("global-bloop")) - fmt.Printf("%#v\n", nc.GlobalInt("global-bips")) - fmt.Printf("%#v\n", nc.GlobalIntSlice("global-blups")) - fmt.Printf("%#v\n", nc.GlobalString("global-snurt")) - fmt.Printf("%#v\n", nc.GlobalStringSlice("global-snurkles")) - - fmt.Printf("%#v\n", nc.FlagNames()) - fmt.Printf("%#v\n", nc.GlobalFlagNames()) - fmt.Printf("%#v\n", nc.GlobalIsSet("wat")) - fmt.Printf("%#v\n", nc.GlobalSet("wat", "nope")) - fmt.Printf("%#v\n", nc.NArg()) - fmt.Printf("%#v\n", nc.NumFlags()) - fmt.Printf("%#v\n", nc.Parent()) - - nc.Set("wat", "also-nope") - - ec := cli.NewExitError("ohwell", 86) - fmt.Fprintf(c.App.Writer, "%d", ec.ExitCode()) - fmt.Printf("made it!\n") - return ec - } - - if os.Getenv("HEXY") != "" { - app.Writer = &hexWriter{} - app.ErrWriter = &hexWriter{} - } - - app.Metadata = map[string]interface{}{ - "layers": "many", - "explicable": false, - "whatever-values": 19.99, - } - - app.Run(os.Args) -} - -func wopAction(c *cli.Context) error { - fmt.Fprintf(c.App.Writer, ":wave: over here, eh\n") - return nil -} -``` - -## Contribution Guidelines - -Feel free to put up a pull request to fix a bug or maybe add a feature. I will -give it a code review and make sure that it does not break backwards -compatibility. If I or any other collaborators agree that it is in line with -the vision of the project, we will work with you to get the code into -a mergeable state and merge it into the master branch. - -If you have contributed something significant to the project, we will most -likely add you as a collaborator. As a collaborator you are given the ability -to merge others pull requests. It is very important that new code does not -break existing code, so be careful about what code you do choose to merge. - -If you feel like you have contributed to the project but have not yet been -added as a collaborator, we probably forgot to add you, please open an issue. diff --git a/vendor/github.com/urfave/cli/app.go b/vendor/github.com/urfave/cli/app.go deleted file mode 100644 index 51fc45d..0000000 --- a/vendor/github.com/urfave/cli/app.go +++ /dev/null @@ -1,497 +0,0 @@ -package cli - -import ( - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "sort" - "time" -) - -var ( - changeLogURL = "https://github.com/urfave/cli/blob/master/CHANGELOG.md" - appActionDeprecationURL = fmt.Sprintf("%s#deprecated-cli-app-action-signature", changeLogURL) - runAndExitOnErrorDeprecationURL = fmt.Sprintf("%s#deprecated-cli-app-runandexitonerror", changeLogURL) - - contactSysadmin = "This is an error in the application. Please contact the distributor of this application if this is not you." - - errInvalidActionType = NewExitError("ERROR invalid Action type. "+ - fmt.Sprintf("Must be `func(*Context`)` or `func(*Context) error). %s", contactSysadmin)+ - fmt.Sprintf("See %s", appActionDeprecationURL), 2) -) - -// App is the main structure of a cli application. It is recommended that -// an app be created with the cli.NewApp() function -type App struct { - // The name of the program. Defaults to path.Base(os.Args[0]) - Name string - // Full name of command for help, defaults to Name - HelpName string - // Description of the program. - Usage string - // Text to override the USAGE section of help - UsageText string - // Description of the program argument format. - ArgsUsage string - // Version of the program - Version string - // Description of the program - Description string - // List of commands to execute - Commands []Command - // List of flags to parse - Flags []Flag - // Boolean to enable bash completion commands - EnableBashCompletion bool - // Boolean to hide built-in help command - HideHelp bool - // Boolean to hide built-in version flag and the VERSION section of help - HideVersion bool - // Populate on app startup, only gettable through method Categories() - categories CommandCategories - // An action to execute when the bash-completion flag is set - BashComplete BashCompleteFunc - // An action to execute before any subcommands are run, but after the context is ready - // If a non-nil error is returned, no subcommands are run - Before BeforeFunc - // An action to execute after any subcommands are run, but after the subcommand has finished - // It is run even if Action() panics - After AfterFunc - - // The action to execute when no subcommands are specified - // Expects a `cli.ActionFunc` but will accept the *deprecated* signature of `func(*cli.Context) {}` - // *Note*: support for the deprecated `Action` signature will be removed in a future version - Action interface{} - - // Execute this function if the proper command cannot be found - CommandNotFound CommandNotFoundFunc - // Execute this function if an usage error occurs - OnUsageError OnUsageErrorFunc - // Compilation date - Compiled time.Time - // List of all authors who contributed - Authors []Author - // Copyright of the binary if any - Copyright string - // Name of Author (Note: Use App.Authors, this is deprecated) - Author string - // Email of Author (Note: Use App.Authors, this is deprecated) - Email string - // Writer writer to write output to - Writer io.Writer - // ErrWriter writes error output - ErrWriter io.Writer - // Other custom info - Metadata map[string]interface{} - // Carries a function which returns app specific info. - ExtraInfo func() map[string]string - // CustomAppHelpTemplate the text template for app help topic. - // cli.go uses text/template to render templates. You can - // render custom help text by setting this variable. - CustomAppHelpTemplate string - - didSetup bool -} - -// Tries to find out when this binary was compiled. -// Returns the current time if it fails to find it. -func compileTime() time.Time { - info, err := os.Stat(os.Args[0]) - if err != nil { - return time.Now() - } - return info.ModTime() -} - -// NewApp creates a new cli Application with some reasonable defaults for Name, -// Usage, Version and Action. -func NewApp() *App { - return &App{ - Name: filepath.Base(os.Args[0]), - HelpName: filepath.Base(os.Args[0]), - Usage: "A new cli application", - UsageText: "", - Version: "0.0.0", - BashComplete: DefaultAppComplete, - Action: helpCommand.Action, - Compiled: compileTime(), - Writer: os.Stdout, - } -} - -// Setup runs initialization code to ensure all data structures are ready for -// `Run` or inspection prior to `Run`. It is internally called by `Run`, but -// will return early if setup has already happened. -func (a *App) Setup() { - if a.didSetup { - return - } - - a.didSetup = true - - if a.Author != "" || a.Email != "" { - a.Authors = append(a.Authors, Author{Name: a.Author, Email: a.Email}) - } - - newCmds := []Command{} - for _, c := range a.Commands { - if c.HelpName == "" { - c.HelpName = fmt.Sprintf("%s %s", a.HelpName, c.Name) - } - newCmds = append(newCmds, c) - } - a.Commands = newCmds - - if a.Command(helpCommand.Name) == nil && !a.HideHelp { - a.Commands = append(a.Commands, helpCommand) - if (HelpFlag != BoolFlag{}) { - a.appendFlag(HelpFlag) - } - } - - if !a.HideVersion { - a.appendFlag(VersionFlag) - } - - a.categories = CommandCategories{} - for _, command := range a.Commands { - a.categories = a.categories.AddCommand(command.Category, command) - } - sort.Sort(a.categories) - - if a.Metadata == nil { - a.Metadata = make(map[string]interface{}) - } - - if a.Writer == nil { - a.Writer = os.Stdout - } -} - -// Run is the entry point to the cli app. Parses the arguments slice and routes -// to the proper flag/args combination -func (a *App) Run(arguments []string) (err error) { - a.Setup() - - // handle the completion flag separately from the flagset since - // completion could be attempted after a flag, but before its value was put - // on the command line. this causes the flagset to interpret the completion - // flag name as the value of the flag before it which is undesirable - // note that we can only do this because the shell autocomplete function - // always appends the completion flag at the end of the command - shellComplete, arguments := checkShellCompleteFlag(a, arguments) - - // parse flags - set, err := flagSet(a.Name, a.Flags) - if err != nil { - return err - } - - set.SetOutput(ioutil.Discard) - err = set.Parse(arguments[1:]) - nerr := normalizeFlags(a.Flags, set) - context := NewContext(a, set, nil) - if nerr != nil { - fmt.Fprintln(a.Writer, nerr) - ShowAppHelp(context) - return nerr - } - context.shellComplete = shellComplete - - if checkCompletions(context) { - return nil - } - - if err != nil { - if a.OnUsageError != nil { - err := a.OnUsageError(context, err, false) - HandleExitCoder(err) - return err - } - fmt.Fprintf(a.Writer, "%s %s\n\n", "Incorrect Usage.", err.Error()) - ShowAppHelp(context) - return err - } - - if !a.HideHelp && checkHelp(context) { - ShowAppHelp(context) - return nil - } - - if !a.HideVersion && checkVersion(context) { - ShowVersion(context) - return nil - } - - if a.After != nil { - defer func() { - if afterErr := a.After(context); afterErr != nil { - if err != nil { - err = NewMultiError(err, afterErr) - } else { - err = afterErr - } - } - }() - } - - if a.Before != nil { - beforeErr := a.Before(context) - if beforeErr != nil { - ShowAppHelp(context) - HandleExitCoder(beforeErr) - err = beforeErr - return err - } - } - - args := context.Args() - if args.Present() { - name := args.First() - c := a.Command(name) - if c != nil { - return c.Run(context) - } - } - - if a.Action == nil { - a.Action = helpCommand.Action - } - - // Run default Action - err = HandleAction(a.Action, context) - - HandleExitCoder(err) - return err -} - -// RunAndExitOnError calls .Run() and exits non-zero if an error was returned -// -// Deprecated: instead you should return an error that fulfills cli.ExitCoder -// to cli.App.Run. This will cause the application to exit with the given eror -// code in the cli.ExitCoder -func (a *App) RunAndExitOnError() { - if err := a.Run(os.Args); err != nil { - fmt.Fprintln(a.errWriter(), err) - OsExiter(1) - } -} - -// RunAsSubcommand invokes the subcommand given the context, parses ctx.Args() to -// generate command-specific flags -func (a *App) RunAsSubcommand(ctx *Context) (err error) { - // append help to commands - if len(a.Commands) > 0 { - if a.Command(helpCommand.Name) == nil && !a.HideHelp { - a.Commands = append(a.Commands, helpCommand) - if (HelpFlag != BoolFlag{}) { - a.appendFlag(HelpFlag) - } - } - } - - newCmds := []Command{} - for _, c := range a.Commands { - if c.HelpName == "" { - c.HelpName = fmt.Sprintf("%s %s", a.HelpName, c.Name) - } - newCmds = append(newCmds, c) - } - a.Commands = newCmds - - // parse flags - set, err := flagSet(a.Name, a.Flags) - if err != nil { - return err - } - - set.SetOutput(ioutil.Discard) - err = set.Parse(ctx.Args().Tail()) - nerr := normalizeFlags(a.Flags, set) - context := NewContext(a, set, ctx) - - if nerr != nil { - fmt.Fprintln(a.Writer, nerr) - fmt.Fprintln(a.Writer) - if len(a.Commands) > 0 { - ShowSubcommandHelp(context) - } else { - ShowCommandHelp(ctx, context.Args().First()) - } - return nerr - } - - if checkCompletions(context) { - return nil - } - - if err != nil { - if a.OnUsageError != nil { - err = a.OnUsageError(context, err, true) - HandleExitCoder(err) - return err - } - fmt.Fprintf(a.Writer, "%s %s\n\n", "Incorrect Usage.", err.Error()) - ShowSubcommandHelp(context) - return err - } - - if len(a.Commands) > 0 { - if checkSubcommandHelp(context) { - return nil - } - } else { - if checkCommandHelp(ctx, context.Args().First()) { - return nil - } - } - - if a.After != nil { - defer func() { - afterErr := a.After(context) - if afterErr != nil { - HandleExitCoder(err) - if err != nil { - err = NewMultiError(err, afterErr) - } else { - err = afterErr - } - } - }() - } - - if a.Before != nil { - beforeErr := a.Before(context) - if beforeErr != nil { - HandleExitCoder(beforeErr) - err = beforeErr - return err - } - } - - args := context.Args() - if args.Present() { - name := args.First() - c := a.Command(name) - if c != nil { - return c.Run(context) - } - } - - // Run default Action - err = HandleAction(a.Action, context) - - HandleExitCoder(err) - return err -} - -// Command returns the named command on App. Returns nil if the command does not exist -func (a *App) Command(name string) *Command { - for _, c := range a.Commands { - if c.HasName(name) { - return &c - } - } - - return nil -} - -// Categories returns a slice containing all the categories with the commands they contain -func (a *App) Categories() CommandCategories { - return a.categories -} - -// VisibleCategories returns a slice of categories and commands that are -// Hidden=false -func (a *App) VisibleCategories() []*CommandCategory { - ret := []*CommandCategory{} - for _, category := range a.categories { - if visible := func() *CommandCategory { - for _, command := range category.Commands { - if !command.Hidden { - return category - } - } - return nil - }(); visible != nil { - ret = append(ret, visible) - } - } - return ret -} - -// VisibleCommands returns a slice of the Commands with Hidden=false -func (a *App) VisibleCommands() []Command { - ret := []Command{} - for _, command := range a.Commands { - if !command.Hidden { - ret = append(ret, command) - } - } - return ret -} - -// VisibleFlags returns a slice of the Flags with Hidden=false -func (a *App) VisibleFlags() []Flag { - return visibleFlags(a.Flags) -} - -func (a *App) hasFlag(flag Flag) bool { - for _, f := range a.Flags { - if flag == f { - return true - } - } - - return false -} - -func (a *App) errWriter() io.Writer { - - // When the app ErrWriter is nil use the package level one. - if a.ErrWriter == nil { - return ErrWriter - } - - return a.ErrWriter -} - -func (a *App) appendFlag(flag Flag) { - if !a.hasFlag(flag) { - a.Flags = append(a.Flags, flag) - } -} - -// Author represents someone who has contributed to a cli project. -type Author struct { - Name string // The Authors name - Email string // The Authors email -} - -// String makes Author comply to the Stringer interface, to allow an easy print in the templating process -func (a Author) String() string { - e := "" - if a.Email != "" { - e = " <" + a.Email + ">" - } - - return fmt.Sprintf("%v%v", a.Name, e) -} - -// HandleAction attempts to figure out which Action signature was used. If -// it's an ActionFunc or a func with the legacy signature for Action, the func -// is run! -func HandleAction(action interface{}, context *Context) (err error) { - if a, ok := action.(ActionFunc); ok { - return a(context) - } else if a, ok := action.(func(*Context) error); ok { - return a(context) - } else if a, ok := action.(func(*Context)); ok { // deprecated function signature - a(context) - return nil - } else { - return errInvalidActionType - } -} diff --git a/vendor/github.com/urfave/cli/appveyor.yml b/vendor/github.com/urfave/cli/appveyor.yml deleted file mode 100644 index 698b188..0000000 --- a/vendor/github.com/urfave/cli/appveyor.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: "{build}" - -os: Windows Server 2012 R2 - -clone_folder: c:\gopath\src\github.com\urfave\cli - -environment: - GOPATH: C:\gopath - GOVERSION: 1.6 - PYTHON: C:\Python27-x64 - PYTHON_VERSION: 2.7.x - PYTHON_ARCH: 64 - -install: -- set PATH=%GOPATH%\bin;C:\go\bin;%PATH% -- go version -- go env -- go get github.com/urfave/gfmrun/... -- go get -v -t ./... - -build_script: -- python runtests vet -- python runtests test -- python runtests gfmrun diff --git a/vendor/github.com/urfave/cli/category.go b/vendor/github.com/urfave/cli/category.go deleted file mode 100644 index 1a60550..0000000 --- a/vendor/github.com/urfave/cli/category.go +++ /dev/null @@ -1,44 +0,0 @@ -package cli - -// CommandCategories is a slice of *CommandCategory. -type CommandCategories []*CommandCategory - -// CommandCategory is a category containing commands. -type CommandCategory struct { - Name string - Commands Commands -} - -func (c CommandCategories) Less(i, j int) bool { - return c[i].Name < c[j].Name -} - -func (c CommandCategories) Len() int { - return len(c) -} - -func (c CommandCategories) Swap(i, j int) { - c[i], c[j] = c[j], c[i] -} - -// AddCommand adds a command to a category. -func (c CommandCategories) AddCommand(category string, command Command) CommandCategories { - for _, commandCategory := range c { - if commandCategory.Name == category { - commandCategory.Commands = append(commandCategory.Commands, command) - return c - } - } - return append(c, &CommandCategory{Name: category, Commands: []Command{command}}) -} - -// VisibleCommands returns a slice of the Commands with Hidden=false -func (c *CommandCategory) VisibleCommands() []Command { - ret := []Command{} - for _, command := range c.Commands { - if !command.Hidden { - ret = append(ret, command) - } - } - return ret -} diff --git a/vendor/github.com/urfave/cli/cli.go b/vendor/github.com/urfave/cli/cli.go deleted file mode 100644 index 90c07eb..0000000 --- a/vendor/github.com/urfave/cli/cli.go +++ /dev/null @@ -1,22 +0,0 @@ -// Package cli provides a minimal framework for creating and organizing command line -// Go applications. cli is designed to be easy to understand and write, the most simple -// cli application can be written as follows: -// func main() { -// cli.NewApp().Run(os.Args) -// } -// -// Of course this application does not do much, so let's make this an actual application: -// func main() { -// app := cli.NewApp() -// app.Name = "greet" -// app.Usage = "say a greeting" -// app.Action = func(c *cli.Context) error { -// println("Greetings") -// return nil -// } -// -// app.Run(os.Args) -// } -package cli - -//go:generate python ./generate-flag-types cli -i flag-types.json -o flag_generated.go diff --git a/vendor/github.com/urfave/cli/command.go b/vendor/github.com/urfave/cli/command.go deleted file mode 100644 index 23de294..0000000 --- a/vendor/github.com/urfave/cli/command.go +++ /dev/null @@ -1,304 +0,0 @@ -package cli - -import ( - "fmt" - "io/ioutil" - "sort" - "strings" -) - -// Command is a subcommand for a cli.App. -type Command struct { - // The name of the command - Name string - // short name of the command. Typically one character (deprecated, use `Aliases`) - ShortName string - // A list of aliases for the command - Aliases []string - // A short description of the usage of this command - Usage string - // Custom text to show on USAGE section of help - UsageText string - // A longer explanation of how the command works - Description string - // A short description of the arguments of this command - ArgsUsage string - // The category the command is part of - Category string - // The function to call when checking for bash command completions - BashComplete BashCompleteFunc - // An action to execute before any sub-subcommands are run, but after the context is ready - // If a non-nil error is returned, no sub-subcommands are run - Before BeforeFunc - // An action to execute after any subcommands are run, but after the subcommand has finished - // It is run even if Action() panics - After AfterFunc - // The function to call when this command is invoked - Action interface{} - // TODO: replace `Action: interface{}` with `Action: ActionFunc` once some kind - // of deprecation period has passed, maybe? - - // Execute this function if a usage error occurs. - OnUsageError OnUsageErrorFunc - // List of child commands - Subcommands Commands - // List of flags to parse - Flags []Flag - // Treat all flags as normal arguments if true - SkipFlagParsing bool - // Skip argument reordering which attempts to move flags before arguments, - // but only works if all flags appear after all arguments. This behavior was - // removed n version 2 since it only works under specific conditions so we - // backport here by exposing it as an option for compatibility. - SkipArgReorder bool - // Boolean to hide built-in help command - HideHelp bool - // Boolean to hide this command from help or completion - Hidden bool - - // Full name of command for help, defaults to full command name, including parent commands. - HelpName string - commandNamePath []string - - // CustomHelpTemplate the text template for the command help topic. - // cli.go uses text/template to render templates. You can - // render custom help text by setting this variable. - CustomHelpTemplate string -} - -type CommandsByName []Command - -func (c CommandsByName) Len() int { - return len(c) -} - -func (c CommandsByName) Less(i, j int) bool { - return c[i].Name < c[j].Name -} - -func (c CommandsByName) Swap(i, j int) { - c[i], c[j] = c[j], c[i] -} - -// FullName returns the full name of the command. -// For subcommands this ensures that parent commands are part of the command path -func (c Command) FullName() string { - if c.commandNamePath == nil { - return c.Name - } - return strings.Join(c.commandNamePath, " ") -} - -// Commands is a slice of Command -type Commands []Command - -// Run invokes the command given the context, parses ctx.Args() to generate command-specific flags -func (c Command) Run(ctx *Context) (err error) { - if len(c.Subcommands) > 0 { - return c.startApp(ctx) - } - - if !c.HideHelp && (HelpFlag != BoolFlag{}) { - // append help to flags - c.Flags = append( - c.Flags, - HelpFlag, - ) - } - - set, err := flagSet(c.Name, c.Flags) - if err != nil { - return err - } - set.SetOutput(ioutil.Discard) - - if c.SkipFlagParsing { - err = set.Parse(append([]string{"--"}, ctx.Args().Tail()...)) - } else if !c.SkipArgReorder { - firstFlagIndex := -1 - terminatorIndex := -1 - for index, arg := range ctx.Args() { - if arg == "--" { - terminatorIndex = index - break - } else if arg == "-" { - // Do nothing. A dash alone is not really a flag. - continue - } else if strings.HasPrefix(arg, "-") && firstFlagIndex == -1 { - firstFlagIndex = index - } - } - - if firstFlagIndex > -1 { - args := ctx.Args() - regularArgs := make([]string, len(args[1:firstFlagIndex])) - copy(regularArgs, args[1:firstFlagIndex]) - - var flagArgs []string - if terminatorIndex > -1 { - flagArgs = args[firstFlagIndex:terminatorIndex] - regularArgs = append(regularArgs, args[terminatorIndex:]...) - } else { - flagArgs = args[firstFlagIndex:] - } - - err = set.Parse(append(flagArgs, regularArgs...)) - } else { - err = set.Parse(ctx.Args().Tail()) - } - } else { - err = set.Parse(ctx.Args().Tail()) - } - - nerr := normalizeFlags(c.Flags, set) - if nerr != nil { - fmt.Fprintln(ctx.App.Writer, nerr) - fmt.Fprintln(ctx.App.Writer) - ShowCommandHelp(ctx, c.Name) - return nerr - } - - context := NewContext(ctx.App, set, ctx) - context.Command = c - if checkCommandCompletions(context, c.Name) { - return nil - } - - if err != nil { - if c.OnUsageError != nil { - err := c.OnUsageError(context, err, false) - HandleExitCoder(err) - return err - } - fmt.Fprintln(context.App.Writer, "Incorrect Usage:", err.Error()) - fmt.Fprintln(context.App.Writer) - ShowCommandHelp(context, c.Name) - return err - } - - if checkCommandHelp(context, c.Name) { - return nil - } - - if c.After != nil { - defer func() { - afterErr := c.After(context) - if afterErr != nil { - HandleExitCoder(err) - if err != nil { - err = NewMultiError(err, afterErr) - } else { - err = afterErr - } - } - }() - } - - if c.Before != nil { - err = c.Before(context) - if err != nil { - ShowCommandHelp(context, c.Name) - HandleExitCoder(err) - return err - } - } - - if c.Action == nil { - c.Action = helpSubcommand.Action - } - - err = HandleAction(c.Action, context) - - if err != nil { - HandleExitCoder(err) - } - return err -} - -// Names returns the names including short names and aliases. -func (c Command) Names() []string { - names := []string{c.Name} - - if c.ShortName != "" { - names = append(names, c.ShortName) - } - - return append(names, c.Aliases...) -} - -// HasName returns true if Command.Name or Command.ShortName matches given name -func (c Command) HasName(name string) bool { - for _, n := range c.Names() { - if n == name { - return true - } - } - return false -} - -func (c Command) startApp(ctx *Context) error { - app := NewApp() - app.Metadata = ctx.App.Metadata - // set the name and usage - app.Name = fmt.Sprintf("%s %s", ctx.App.Name, c.Name) - if c.HelpName == "" { - app.HelpName = c.HelpName - } else { - app.HelpName = app.Name - } - - app.Usage = c.Usage - app.Description = c.Description - app.ArgsUsage = c.ArgsUsage - - // set CommandNotFound - app.CommandNotFound = ctx.App.CommandNotFound - app.CustomAppHelpTemplate = c.CustomHelpTemplate - - // set the flags and commands - app.Commands = c.Subcommands - app.Flags = c.Flags - app.HideHelp = c.HideHelp - - app.Version = ctx.App.Version - app.HideVersion = ctx.App.HideVersion - app.Compiled = ctx.App.Compiled - app.Author = ctx.App.Author - app.Email = ctx.App.Email - app.Writer = ctx.App.Writer - app.ErrWriter = ctx.App.ErrWriter - - app.categories = CommandCategories{} - for _, command := range c.Subcommands { - app.categories = app.categories.AddCommand(command.Category, command) - } - - sort.Sort(app.categories) - - // bash completion - app.EnableBashCompletion = ctx.App.EnableBashCompletion - if c.BashComplete != nil { - app.BashComplete = c.BashComplete - } - - // set the actions - app.Before = c.Before - app.After = c.After - if c.Action != nil { - app.Action = c.Action - } else { - app.Action = helpSubcommand.Action - } - app.OnUsageError = c.OnUsageError - - for index, cc := range app.Commands { - app.Commands[index].commandNamePath = []string{c.Name, cc.Name} - } - - return app.RunAsSubcommand(ctx) -} - -// VisibleFlags returns a slice of the Flags with Hidden=false -func (c Command) VisibleFlags() []Flag { - return visibleFlags(c.Flags) -} diff --git a/vendor/github.com/urfave/cli/context.go b/vendor/github.com/urfave/cli/context.go deleted file mode 100644 index db94191..0000000 --- a/vendor/github.com/urfave/cli/context.go +++ /dev/null @@ -1,278 +0,0 @@ -package cli - -import ( - "errors" - "flag" - "reflect" - "strings" - "syscall" -) - -// Context is a type that is passed through to -// each Handler action in a cli application. Context -// can be used to retrieve context-specific Args and -// parsed command-line options. -type Context struct { - App *App - Command Command - shellComplete bool - flagSet *flag.FlagSet - setFlags map[string]bool - parentContext *Context -} - -// NewContext creates a new context. For use in when invoking an App or Command action. -func NewContext(app *App, set *flag.FlagSet, parentCtx *Context) *Context { - c := &Context{App: app, flagSet: set, parentContext: parentCtx} - - if parentCtx != nil { - c.shellComplete = parentCtx.shellComplete - } - - return c -} - -// NumFlags returns the number of flags set -func (c *Context) NumFlags() int { - return c.flagSet.NFlag() -} - -// Set sets a context flag to a value. -func (c *Context) Set(name, value string) error { - c.setFlags = nil - return c.flagSet.Set(name, value) -} - -// GlobalSet sets a context flag to a value on the global flagset -func (c *Context) GlobalSet(name, value string) error { - globalContext(c).setFlags = nil - return globalContext(c).flagSet.Set(name, value) -} - -// IsSet determines if the flag was actually set -func (c *Context) IsSet(name string) bool { - if c.setFlags == nil { - c.setFlags = make(map[string]bool) - - c.flagSet.Visit(func(f *flag.Flag) { - c.setFlags[f.Name] = true - }) - - c.flagSet.VisitAll(func(f *flag.Flag) { - if _, ok := c.setFlags[f.Name]; ok { - return - } - c.setFlags[f.Name] = false - }) - - // XXX hack to support IsSet for flags with EnvVar - // - // There isn't an easy way to do this with the current implementation since - // whether a flag was set via an environment variable is very difficult to - // determine here. Instead, we intend to introduce a backwards incompatible - // change in version 2 to add `IsSet` to the Flag interface to push the - // responsibility closer to where the information required to determine - // whether a flag is set by non-standard means such as environment - // variables is avaliable. - // - // See https://github.com/urfave/cli/issues/294 for additional discussion - flags := c.Command.Flags - if c.Command.Name == "" { // cannot == Command{} since it contains slice types - if c.App != nil { - flags = c.App.Flags - } - } - for _, f := range flags { - eachName(f.GetName(), func(name string) { - if isSet, ok := c.setFlags[name]; isSet || !ok { - return - } - - val := reflect.ValueOf(f) - if val.Kind() == reflect.Ptr { - val = val.Elem() - } - - envVarValue := val.FieldByName("EnvVar") - if !envVarValue.IsValid() { - return - } - - eachName(envVarValue.String(), func(envVar string) { - envVar = strings.TrimSpace(envVar) - if _, ok := syscall.Getenv(envVar); ok { - c.setFlags[name] = true - return - } - }) - }) - } - } - - return c.setFlags[name] -} - -// GlobalIsSet determines if the global flag was actually set -func (c *Context) GlobalIsSet(name string) bool { - ctx := c - if ctx.parentContext != nil { - ctx = ctx.parentContext - } - - for ; ctx != nil; ctx = ctx.parentContext { - if ctx.IsSet(name) { - return true - } - } - return false -} - -// FlagNames returns a slice of flag names used in this context. -func (c *Context) FlagNames() (names []string) { - for _, flag := range c.Command.Flags { - name := strings.Split(flag.GetName(), ",")[0] - if name == "help" { - continue - } - names = append(names, name) - } - return -} - -// GlobalFlagNames returns a slice of global flag names used by the app. -func (c *Context) GlobalFlagNames() (names []string) { - for _, flag := range c.App.Flags { - name := strings.Split(flag.GetName(), ",")[0] - if name == "help" || name == "version" { - continue - } - names = append(names, name) - } - return -} - -// Parent returns the parent context, if any -func (c *Context) Parent() *Context { - return c.parentContext -} - -// value returns the value of the flag coressponding to `name` -func (c *Context) value(name string) interface{} { - return c.flagSet.Lookup(name).Value.(flag.Getter).Get() -} - -// Args contains apps console arguments -type Args []string - -// Args returns the command line arguments associated with the context. -func (c *Context) Args() Args { - args := Args(c.flagSet.Args()) - return args -} - -// NArg returns the number of the command line arguments. -func (c *Context) NArg() int { - return len(c.Args()) -} - -// Get returns the nth argument, or else a blank string -func (a Args) Get(n int) string { - if len(a) > n { - return a[n] - } - return "" -} - -// First returns the first argument, or else a blank string -func (a Args) First() string { - return a.Get(0) -} - -// Tail returns the rest of the arguments (not the first one) -// or else an empty string slice -func (a Args) Tail() []string { - if len(a) >= 2 { - return []string(a)[1:] - } - return []string{} -} - -// Present checks if there are any arguments present -func (a Args) Present() bool { - return len(a) != 0 -} - -// Swap swaps arguments at the given indexes -func (a Args) Swap(from, to int) error { - if from >= len(a) || to >= len(a) { - return errors.New("index out of range") - } - a[from], a[to] = a[to], a[from] - return nil -} - -func globalContext(ctx *Context) *Context { - if ctx == nil { - return nil - } - - for { - if ctx.parentContext == nil { - return ctx - } - ctx = ctx.parentContext - } -} - -func lookupGlobalFlagSet(name string, ctx *Context) *flag.FlagSet { - if ctx.parentContext != nil { - ctx = ctx.parentContext - } - for ; ctx != nil; ctx = ctx.parentContext { - if f := ctx.flagSet.Lookup(name); f != nil { - return ctx.flagSet - } - } - return nil -} - -func copyFlag(name string, ff *flag.Flag, set *flag.FlagSet) { - switch ff.Value.(type) { - case *StringSlice: - default: - set.Set(name, ff.Value.String()) - } -} - -func normalizeFlags(flags []Flag, set *flag.FlagSet) error { - visited := make(map[string]bool) - set.Visit(func(f *flag.Flag) { - visited[f.Name] = true - }) - for _, f := range flags { - parts := strings.Split(f.GetName(), ",") - if len(parts) == 1 { - continue - } - var ff *flag.Flag - for _, name := range parts { - name = strings.Trim(name, " ") - if visited[name] { - if ff != nil { - return errors.New("Cannot use two forms of the same flag: " + name + " " + ff.Name) - } - ff = set.Lookup(name) - } - } - if ff == nil { - continue - } - for _, name := range parts { - name = strings.Trim(name, " ") - if !visited[name] { - copyFlag(name, ff, set) - } - } - } - return nil -} diff --git a/vendor/github.com/urfave/cli/errors.go b/vendor/github.com/urfave/cli/errors.go deleted file mode 100644 index 562b295..0000000 --- a/vendor/github.com/urfave/cli/errors.go +++ /dev/null @@ -1,115 +0,0 @@ -package cli - -import ( - "fmt" - "io" - "os" - "strings" -) - -// OsExiter is the function used when the app exits. If not set defaults to os.Exit. -var OsExiter = os.Exit - -// ErrWriter is used to write errors to the user. This can be anything -// implementing the io.Writer interface and defaults to os.Stderr. -var ErrWriter io.Writer = os.Stderr - -// MultiError is an error that wraps multiple errors. -type MultiError struct { - Errors []error -} - -// NewMultiError creates a new MultiError. Pass in one or more errors. -func NewMultiError(err ...error) MultiError { - return MultiError{Errors: err} -} - -// Error implements the error interface. -func (m MultiError) Error() string { - errs := make([]string, len(m.Errors)) - for i, err := range m.Errors { - errs[i] = err.Error() - } - - return strings.Join(errs, "\n") -} - -type ErrorFormatter interface { - Format(s fmt.State, verb rune) -} - -// ExitCoder is the interface checked by `App` and `Command` for a custom exit -// code -type ExitCoder interface { - error - ExitCode() int -} - -// ExitError fulfills both the builtin `error` interface and `ExitCoder` -type ExitError struct { - exitCode int - message interface{} -} - -// NewExitError makes a new *ExitError -func NewExitError(message interface{}, exitCode int) *ExitError { - return &ExitError{ - exitCode: exitCode, - message: message, - } -} - -// Error returns the string message, fulfilling the interface required by -// `error` -func (ee *ExitError) Error() string { - return fmt.Sprintf("%v", ee.message) -} - -// ExitCode returns the exit code, fulfilling the interface required by -// `ExitCoder` -func (ee *ExitError) ExitCode() int { - return ee.exitCode -} - -// HandleExitCoder checks if the error fulfills the ExitCoder interface, and if -// so prints the error to stderr (if it is non-empty) and calls OsExiter with the -// given exit code. If the given error is a MultiError, then this func is -// called on all members of the Errors slice and calls OsExiter with the last exit code. -func HandleExitCoder(err error) { - if err == nil { - return - } - - if exitErr, ok := err.(ExitCoder); ok { - if err.Error() != "" { - if _, ok := exitErr.(ErrorFormatter); ok { - fmt.Fprintf(ErrWriter, "%+v\n", err) - } else { - fmt.Fprintln(ErrWriter, err) - } - } - OsExiter(exitErr.ExitCode()) - return - } - - if multiErr, ok := err.(MultiError); ok { - code := handleMultiError(multiErr) - OsExiter(code) - return - } -} - -func handleMultiError(multiErr MultiError) int { - code := 1 - for _, merr := range multiErr.Errors { - if multiErr2, ok := merr.(MultiError); ok { - code = handleMultiError(multiErr2) - } else { - fmt.Fprintln(ErrWriter, merr) - if exitErr, ok := merr.(ExitCoder); ok { - code = exitErr.ExitCode() - } - } - } - return code -} diff --git a/vendor/github.com/urfave/cli/flag-types.json b/vendor/github.com/urfave/cli/flag-types.json deleted file mode 100644 index 1223107..0000000 --- a/vendor/github.com/urfave/cli/flag-types.json +++ /dev/null @@ -1,93 +0,0 @@ -[ - { - "name": "Bool", - "type": "bool", - "value": false, - "context_default": "false", - "parser": "strconv.ParseBool(f.Value.String())" - }, - { - "name": "BoolT", - "type": "bool", - "value": false, - "doctail": " that is true by default", - "context_default": "false", - "parser": "strconv.ParseBool(f.Value.String())" - }, - { - "name": "Duration", - "type": "time.Duration", - "doctail": " (see https://golang.org/pkg/time/#ParseDuration)", - "context_default": "0", - "parser": "time.ParseDuration(f.Value.String())" - }, - { - "name": "Float64", - "type": "float64", - "context_default": "0", - "parser": "strconv.ParseFloat(f.Value.String(), 64)" - }, - { - "name": "Generic", - "type": "Generic", - "dest": false, - "context_default": "nil", - "context_type": "interface{}" - }, - { - "name": "Int64", - "type": "int64", - "context_default": "0", - "parser": "strconv.ParseInt(f.Value.String(), 0, 64)" - }, - { - "name": "Int", - "type": "int", - "context_default": "0", - "parser": "strconv.ParseInt(f.Value.String(), 0, 64)", - "parser_cast": "int(parsed)" - }, - { - "name": "IntSlice", - "type": "*IntSlice", - "dest": false, - "context_default": "nil", - "context_type": "[]int", - "parser": "(f.Value.(*IntSlice)).Value(), error(nil)" - }, - { - "name": "Int64Slice", - "type": "*Int64Slice", - "dest": false, - "context_default": "nil", - "context_type": "[]int64", - "parser": "(f.Value.(*Int64Slice)).Value(), error(nil)" - }, - { - "name": "String", - "type": "string", - "context_default": "\"\"", - "parser": "f.Value.String(), error(nil)" - }, - { - "name": "StringSlice", - "type": "*StringSlice", - "dest": false, - "context_default": "nil", - "context_type": "[]string", - "parser": "(f.Value.(*StringSlice)).Value(), error(nil)" - }, - { - "name": "Uint64", - "type": "uint64", - "context_default": "0", - "parser": "strconv.ParseUint(f.Value.String(), 0, 64)" - }, - { - "name": "Uint", - "type": "uint", - "context_default": "0", - "parser": "strconv.ParseUint(f.Value.String(), 0, 64)", - "parser_cast": "uint(parsed)" - } -] diff --git a/vendor/github.com/urfave/cli/flag.go b/vendor/github.com/urfave/cli/flag.go deleted file mode 100644 index 877ff35..0000000 --- a/vendor/github.com/urfave/cli/flag.go +++ /dev/null @@ -1,799 +0,0 @@ -package cli - -import ( - "flag" - "fmt" - "reflect" - "runtime" - "strconv" - "strings" - "syscall" - "time" -) - -const defaultPlaceholder = "value" - -// BashCompletionFlag enables bash-completion for all commands and subcommands -var BashCompletionFlag Flag = BoolFlag{ - Name: "generate-bash-completion", - Hidden: true, -} - -// VersionFlag prints the version for the application -var VersionFlag Flag = BoolFlag{ - Name: "version, v", - Usage: "print the version", -} - -// HelpFlag prints the help for all commands and subcommands -// Set to the zero value (BoolFlag{}) to disable flag -- keeps subcommand -// unless HideHelp is set to true) -var HelpFlag Flag = BoolFlag{ - Name: "help, h", - Usage: "show help", -} - -// FlagStringer converts a flag definition to a string. This is used by help -// to display a flag. -var FlagStringer FlagStringFunc = stringifyFlag - -// FlagsByName is a slice of Flag. -type FlagsByName []Flag - -func (f FlagsByName) Len() int { - return len(f) -} - -func (f FlagsByName) Less(i, j int) bool { - return f[i].GetName() < f[j].GetName() -} - -func (f FlagsByName) Swap(i, j int) { - f[i], f[j] = f[j], f[i] -} - -// Flag is a common interface related to parsing flags in cli. -// For more advanced flag parsing techniques, it is recommended that -// this interface be implemented. -type Flag interface { - fmt.Stringer - // Apply Flag settings to the given flag set - Apply(*flag.FlagSet) - GetName() string -} - -// errorableFlag is an interface that allows us to return errors during apply -// it allows flags defined in this library to return errors in a fashion backwards compatible -// TODO remove in v2 and modify the existing Flag interface to return errors -type errorableFlag interface { - Flag - - ApplyWithError(*flag.FlagSet) error -} - -func flagSet(name string, flags []Flag) (*flag.FlagSet, error) { - set := flag.NewFlagSet(name, flag.ContinueOnError) - - for _, f := range flags { - //TODO remove in v2 when errorableFlag is removed - if ef, ok := f.(errorableFlag); ok { - if err := ef.ApplyWithError(set); err != nil { - return nil, err - } - } else { - f.Apply(set) - } - } - return set, nil -} - -func eachName(longName string, fn func(string)) { - parts := strings.Split(longName, ",") - for _, name := range parts { - name = strings.Trim(name, " ") - fn(name) - } -} - -// Generic is a generic parseable type identified by a specific flag -type Generic interface { - Set(value string) error - String() string -} - -// Apply takes the flagset and calls Set on the generic flag with the value -// provided by the user for parsing by the flag -// Ignores parsing errors -func (f GenericFlag) Apply(set *flag.FlagSet) { - f.ApplyWithError(set) -} - -// ApplyWithError takes the flagset and calls Set on the generic flag with the value -// provided by the user for parsing by the flag -func (f GenericFlag) ApplyWithError(set *flag.FlagSet) error { - val := f.Value - if f.EnvVar != "" { - for _, envVar := range strings.Split(f.EnvVar, ",") { - envVar = strings.TrimSpace(envVar) - if envVal, ok := syscall.Getenv(envVar); ok { - if err := val.Set(envVal); err != nil { - return fmt.Errorf("could not parse %s as value for flag %s: %s", envVal, f.Name, err) - } - break - } - } - } - - eachName(f.Name, func(name string) { - set.Var(f.Value, name, f.Usage) - }) - - return nil -} - -// StringSlice is an opaque type for []string to satisfy flag.Value and flag.Getter -type StringSlice []string - -// Set appends the string value to the list of values -func (f *StringSlice) Set(value string) error { - *f = append(*f, value) - return nil -} - -// String returns a readable representation of this value (for usage defaults) -func (f *StringSlice) String() string { - return fmt.Sprintf("%s", *f) -} - -// Value returns the slice of strings set by this flag -func (f *StringSlice) Value() []string { - return *f -} - -// Get returns the slice of strings set by this flag -func (f *StringSlice) Get() interface{} { - return *f -} - -// Apply populates the flag given the flag set and environment -// Ignores errors -func (f StringSliceFlag) Apply(set *flag.FlagSet) { - f.ApplyWithError(set) -} - -// ApplyWithError populates the flag given the flag set and environment -func (f StringSliceFlag) ApplyWithError(set *flag.FlagSet) error { - if f.EnvVar != "" { - for _, envVar := range strings.Split(f.EnvVar, ",") { - envVar = strings.TrimSpace(envVar) - if envVal, ok := syscall.Getenv(envVar); ok { - newVal := &StringSlice{} - for _, s := range strings.Split(envVal, ",") { - s = strings.TrimSpace(s) - if err := newVal.Set(s); err != nil { - return fmt.Errorf("could not parse %s as string value for flag %s: %s", envVal, f.Name, err) - } - } - f.Value = newVal - break - } - } - } - - eachName(f.Name, func(name string) { - if f.Value == nil { - f.Value = &StringSlice{} - } - set.Var(f.Value, name, f.Usage) - }) - - return nil -} - -// IntSlice is an opaque type for []int to satisfy flag.Value and flag.Getter -type IntSlice []int - -// Set parses the value into an integer and appends it to the list of values -func (f *IntSlice) Set(value string) error { - tmp, err := strconv.Atoi(value) - if err != nil { - return err - } - *f = append(*f, tmp) - return nil -} - -// String returns a readable representation of this value (for usage defaults) -func (f *IntSlice) String() string { - return fmt.Sprintf("%#v", *f) -} - -// Value returns the slice of ints set by this flag -func (f *IntSlice) Value() []int { - return *f -} - -// Get returns the slice of ints set by this flag -func (f *IntSlice) Get() interface{} { - return *f -} - -// Apply populates the flag given the flag set and environment -// Ignores errors -func (f IntSliceFlag) Apply(set *flag.FlagSet) { - f.ApplyWithError(set) -} - -// ApplyWithError populates the flag given the flag set and environment -func (f IntSliceFlag) ApplyWithError(set *flag.FlagSet) error { - if f.EnvVar != "" { - for _, envVar := range strings.Split(f.EnvVar, ",") { - envVar = strings.TrimSpace(envVar) - if envVal, ok := syscall.Getenv(envVar); ok { - newVal := &IntSlice{} - for _, s := range strings.Split(envVal, ",") { - s = strings.TrimSpace(s) - if err := newVal.Set(s); err != nil { - return fmt.Errorf("could not parse %s as int slice value for flag %s: %s", envVal, f.Name, err) - } - } - f.Value = newVal - break - } - } - } - - eachName(f.Name, func(name string) { - if f.Value == nil { - f.Value = &IntSlice{} - } - set.Var(f.Value, name, f.Usage) - }) - - return nil -} - -// Int64Slice is an opaque type for []int to satisfy flag.Value and flag.Getter -type Int64Slice []int64 - -// Set parses the value into an integer and appends it to the list of values -func (f *Int64Slice) Set(value string) error { - tmp, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return err - } - *f = append(*f, tmp) - return nil -} - -// String returns a readable representation of this value (for usage defaults) -func (f *Int64Slice) String() string { - return fmt.Sprintf("%#v", *f) -} - -// Value returns the slice of ints set by this flag -func (f *Int64Slice) Value() []int64 { - return *f -} - -// Get returns the slice of ints set by this flag -func (f *Int64Slice) Get() interface{} { - return *f -} - -// Apply populates the flag given the flag set and environment -// Ignores errors -func (f Int64SliceFlag) Apply(set *flag.FlagSet) { - f.ApplyWithError(set) -} - -// ApplyWithError populates the flag given the flag set and environment -func (f Int64SliceFlag) ApplyWithError(set *flag.FlagSet) error { - if f.EnvVar != "" { - for _, envVar := range strings.Split(f.EnvVar, ",") { - envVar = strings.TrimSpace(envVar) - if envVal, ok := syscall.Getenv(envVar); ok { - newVal := &Int64Slice{} - for _, s := range strings.Split(envVal, ",") { - s = strings.TrimSpace(s) - if err := newVal.Set(s); err != nil { - return fmt.Errorf("could not parse %s as int64 slice value for flag %s: %s", envVal, f.Name, err) - } - } - f.Value = newVal - break - } - } - } - - eachName(f.Name, func(name string) { - if f.Value == nil { - f.Value = &Int64Slice{} - } - set.Var(f.Value, name, f.Usage) - }) - return nil -} - -// Apply populates the flag given the flag set and environment -// Ignores errors -func (f BoolFlag) Apply(set *flag.FlagSet) { - f.ApplyWithError(set) -} - -// ApplyWithError populates the flag given the flag set and environment -func (f BoolFlag) ApplyWithError(set *flag.FlagSet) error { - val := false - if f.EnvVar != "" { - for _, envVar := range strings.Split(f.EnvVar, ",") { - envVar = strings.TrimSpace(envVar) - if envVal, ok := syscall.Getenv(envVar); ok { - if envVal == "" { - val = false - break - } - - envValBool, err := strconv.ParseBool(envVal) - if err != nil { - return fmt.Errorf("could not parse %s as bool value for flag %s: %s", envVal, f.Name, err) - } - - val = envValBool - break - } - } - } - - eachName(f.Name, func(name string) { - if f.Destination != nil { - set.BoolVar(f.Destination, name, val, f.Usage) - return - } - set.Bool(name, val, f.Usage) - }) - - return nil -} - -// Apply populates the flag given the flag set and environment -// Ignores errors -func (f BoolTFlag) Apply(set *flag.FlagSet) { - f.ApplyWithError(set) -} - -// ApplyWithError populates the flag given the flag set and environment -func (f BoolTFlag) ApplyWithError(set *flag.FlagSet) error { - val := true - if f.EnvVar != "" { - for _, envVar := range strings.Split(f.EnvVar, ",") { - envVar = strings.TrimSpace(envVar) - if envVal, ok := syscall.Getenv(envVar); ok { - if envVal == "" { - val = false - break - } - - envValBool, err := strconv.ParseBool(envVal) - if err != nil { - return fmt.Errorf("could not parse %s as bool value for flag %s: %s", envVal, f.Name, err) - } - - val = envValBool - break - } - } - } - - eachName(f.Name, func(name string) { - if f.Destination != nil { - set.BoolVar(f.Destination, name, val, f.Usage) - return - } - set.Bool(name, val, f.Usage) - }) - - return nil -} - -// Apply populates the flag given the flag set and environment -// Ignores errors -func (f StringFlag) Apply(set *flag.FlagSet) { - f.ApplyWithError(set) -} - -// ApplyWithError populates the flag given the flag set and environment -func (f StringFlag) ApplyWithError(set *flag.FlagSet) error { - if f.EnvVar != "" { - for _, envVar := range strings.Split(f.EnvVar, ",") { - envVar = strings.TrimSpace(envVar) - if envVal, ok := syscall.Getenv(envVar); ok { - f.Value = envVal - break - } - } - } - - eachName(f.Name, func(name string) { - if f.Destination != nil { - set.StringVar(f.Destination, name, f.Value, f.Usage) - return - } - set.String(name, f.Value, f.Usage) - }) - - return nil -} - -// Apply populates the flag given the flag set and environment -// Ignores errors -func (f IntFlag) Apply(set *flag.FlagSet) { - f.ApplyWithError(set) -} - -// ApplyWithError populates the flag given the flag set and environment -func (f IntFlag) ApplyWithError(set *flag.FlagSet) error { - if f.EnvVar != "" { - for _, envVar := range strings.Split(f.EnvVar, ",") { - envVar = strings.TrimSpace(envVar) - if envVal, ok := syscall.Getenv(envVar); ok { - envValInt, err := strconv.ParseInt(envVal, 0, 64) - if err != nil { - return fmt.Errorf("could not parse %s as int value for flag %s: %s", envVal, f.Name, err) - } - f.Value = int(envValInt) - break - } - } - } - - eachName(f.Name, func(name string) { - if f.Destination != nil { - set.IntVar(f.Destination, name, f.Value, f.Usage) - return - } - set.Int(name, f.Value, f.Usage) - }) - - return nil -} - -// Apply populates the flag given the flag set and environment -// Ignores errors -func (f Int64Flag) Apply(set *flag.FlagSet) { - f.ApplyWithError(set) -} - -// ApplyWithError populates the flag given the flag set and environment -func (f Int64Flag) ApplyWithError(set *flag.FlagSet) error { - if f.EnvVar != "" { - for _, envVar := range strings.Split(f.EnvVar, ",") { - envVar = strings.TrimSpace(envVar) - if envVal, ok := syscall.Getenv(envVar); ok { - envValInt, err := strconv.ParseInt(envVal, 0, 64) - if err != nil { - return fmt.Errorf("could not parse %s as int value for flag %s: %s", envVal, f.Name, err) - } - - f.Value = envValInt - break - } - } - } - - eachName(f.Name, func(name string) { - if f.Destination != nil { - set.Int64Var(f.Destination, name, f.Value, f.Usage) - return - } - set.Int64(name, f.Value, f.Usage) - }) - - return nil -} - -// Apply populates the flag given the flag set and environment -// Ignores errors -func (f UintFlag) Apply(set *flag.FlagSet) { - f.ApplyWithError(set) -} - -// ApplyWithError populates the flag given the flag set and environment -func (f UintFlag) ApplyWithError(set *flag.FlagSet) error { - if f.EnvVar != "" { - for _, envVar := range strings.Split(f.EnvVar, ",") { - envVar = strings.TrimSpace(envVar) - if envVal, ok := syscall.Getenv(envVar); ok { - envValInt, err := strconv.ParseUint(envVal, 0, 64) - if err != nil { - return fmt.Errorf("could not parse %s as uint value for flag %s: %s", envVal, f.Name, err) - } - - f.Value = uint(envValInt) - break - } - } - } - - eachName(f.Name, func(name string) { - if f.Destination != nil { - set.UintVar(f.Destination, name, f.Value, f.Usage) - return - } - set.Uint(name, f.Value, f.Usage) - }) - - return nil -} - -// Apply populates the flag given the flag set and environment -// Ignores errors -func (f Uint64Flag) Apply(set *flag.FlagSet) { - f.ApplyWithError(set) -} - -// ApplyWithError populates the flag given the flag set and environment -func (f Uint64Flag) ApplyWithError(set *flag.FlagSet) error { - if f.EnvVar != "" { - for _, envVar := range strings.Split(f.EnvVar, ",") { - envVar = strings.TrimSpace(envVar) - if envVal, ok := syscall.Getenv(envVar); ok { - envValInt, err := strconv.ParseUint(envVal, 0, 64) - if err != nil { - return fmt.Errorf("could not parse %s as uint64 value for flag %s: %s", envVal, f.Name, err) - } - - f.Value = uint64(envValInt) - break - } - } - } - - eachName(f.Name, func(name string) { - if f.Destination != nil { - set.Uint64Var(f.Destination, name, f.Value, f.Usage) - return - } - set.Uint64(name, f.Value, f.Usage) - }) - - return nil -} - -// Apply populates the flag given the flag set and environment -// Ignores errors -func (f DurationFlag) Apply(set *flag.FlagSet) { - f.ApplyWithError(set) -} - -// ApplyWithError populates the flag given the flag set and environment -func (f DurationFlag) ApplyWithError(set *flag.FlagSet) error { - if f.EnvVar != "" { - for _, envVar := range strings.Split(f.EnvVar, ",") { - envVar = strings.TrimSpace(envVar) - if envVal, ok := syscall.Getenv(envVar); ok { - envValDuration, err := time.ParseDuration(envVal) - if err != nil { - return fmt.Errorf("could not parse %s as duration for flag %s: %s", envVal, f.Name, err) - } - - f.Value = envValDuration - break - } - } - } - - eachName(f.Name, func(name string) { - if f.Destination != nil { - set.DurationVar(f.Destination, name, f.Value, f.Usage) - return - } - set.Duration(name, f.Value, f.Usage) - }) - - return nil -} - -// Apply populates the flag given the flag set and environment -// Ignores errors -func (f Float64Flag) Apply(set *flag.FlagSet) { - f.ApplyWithError(set) -} - -// ApplyWithError populates the flag given the flag set and environment -func (f Float64Flag) ApplyWithError(set *flag.FlagSet) error { - if f.EnvVar != "" { - for _, envVar := range strings.Split(f.EnvVar, ",") { - envVar = strings.TrimSpace(envVar) - if envVal, ok := syscall.Getenv(envVar); ok { - envValFloat, err := strconv.ParseFloat(envVal, 10) - if err != nil { - return fmt.Errorf("could not parse %s as float64 value for flag %s: %s", envVal, f.Name, err) - } - - f.Value = float64(envValFloat) - break - } - } - } - - eachName(f.Name, func(name string) { - if f.Destination != nil { - set.Float64Var(f.Destination, name, f.Value, f.Usage) - return - } - set.Float64(name, f.Value, f.Usage) - }) - - return nil -} - -func visibleFlags(fl []Flag) []Flag { - visible := []Flag{} - for _, flag := range fl { - field := flagValue(flag).FieldByName("Hidden") - if !field.IsValid() || !field.Bool() { - visible = append(visible, flag) - } - } - return visible -} - -func prefixFor(name string) (prefix string) { - if len(name) == 1 { - prefix = "-" - } else { - prefix = "--" - } - - return -} - -// Returns the placeholder, if any, and the unquoted usage string. -func unquoteUsage(usage string) (string, string) { - for i := 0; i < len(usage); i++ { - if usage[i] == '`' { - for j := i + 1; j < len(usage); j++ { - if usage[j] == '`' { - name := usage[i+1 : j] - usage = usage[:i] + name + usage[j+1:] - return name, usage - } - } - break - } - } - return "", usage -} - -func prefixedNames(fullName, placeholder string) string { - var prefixed string - parts := strings.Split(fullName, ",") - for i, name := range parts { - name = strings.Trim(name, " ") - prefixed += prefixFor(name) + name - if placeholder != "" { - prefixed += " " + placeholder - } - if i < len(parts)-1 { - prefixed += ", " - } - } - return prefixed -} - -func withEnvHint(envVar, str string) string { - envText := "" - if envVar != "" { - prefix := "$" - suffix := "" - sep := ", $" - if runtime.GOOS == "windows" { - prefix = "%" - suffix = "%" - sep = "%, %" - } - envText = fmt.Sprintf(" [%s%s%s]", prefix, strings.Join(strings.Split(envVar, ","), sep), suffix) - } - return str + envText -} - -func flagValue(f Flag) reflect.Value { - fv := reflect.ValueOf(f) - for fv.Kind() == reflect.Ptr { - fv = reflect.Indirect(fv) - } - return fv -} - -func stringifyFlag(f Flag) string { - fv := flagValue(f) - - switch f.(type) { - case IntSliceFlag: - return withEnvHint(fv.FieldByName("EnvVar").String(), - stringifyIntSliceFlag(f.(IntSliceFlag))) - case Int64SliceFlag: - return withEnvHint(fv.FieldByName("EnvVar").String(), - stringifyInt64SliceFlag(f.(Int64SliceFlag))) - case StringSliceFlag: - return withEnvHint(fv.FieldByName("EnvVar").String(), - stringifyStringSliceFlag(f.(StringSliceFlag))) - } - - placeholder, usage := unquoteUsage(fv.FieldByName("Usage").String()) - - needsPlaceholder := false - defaultValueString := "" - - if val := fv.FieldByName("Value"); val.IsValid() { - needsPlaceholder = true - defaultValueString = fmt.Sprintf(" (default: %v)", val.Interface()) - - if val.Kind() == reflect.String && val.String() != "" { - defaultValueString = fmt.Sprintf(" (default: %q)", val.String()) - } - } - - if defaultValueString == " (default: )" { - defaultValueString = "" - } - - if needsPlaceholder && placeholder == "" { - placeholder = defaultPlaceholder - } - - usageWithDefault := strings.TrimSpace(fmt.Sprintf("%s%s", usage, defaultValueString)) - - return withEnvHint(fv.FieldByName("EnvVar").String(), - fmt.Sprintf("%s\t%s", prefixedNames(fv.FieldByName("Name").String(), placeholder), usageWithDefault)) -} - -func stringifyIntSliceFlag(f IntSliceFlag) string { - defaultVals := []string{} - if f.Value != nil && len(f.Value.Value()) > 0 { - for _, i := range f.Value.Value() { - defaultVals = append(defaultVals, fmt.Sprintf("%d", i)) - } - } - - return stringifySliceFlag(f.Usage, f.Name, defaultVals) -} - -func stringifyInt64SliceFlag(f Int64SliceFlag) string { - defaultVals := []string{} - if f.Value != nil && len(f.Value.Value()) > 0 { - for _, i := range f.Value.Value() { - defaultVals = append(defaultVals, fmt.Sprintf("%d", i)) - } - } - - return stringifySliceFlag(f.Usage, f.Name, defaultVals) -} - -func stringifyStringSliceFlag(f StringSliceFlag) string { - defaultVals := []string{} - if f.Value != nil && len(f.Value.Value()) > 0 { - for _, s := range f.Value.Value() { - if len(s) > 0 { - defaultVals = append(defaultVals, fmt.Sprintf("%q", s)) - } - } - } - - return stringifySliceFlag(f.Usage, f.Name, defaultVals) -} - -func stringifySliceFlag(usage, name string, defaultVals []string) string { - placeholder, usage := unquoteUsage(usage) - if placeholder == "" { - placeholder = defaultPlaceholder - } - - defaultVal := "" - if len(defaultVals) > 0 { - defaultVal = fmt.Sprintf(" (default: %s)", strings.Join(defaultVals, ", ")) - } - - usageWithDefault := strings.TrimSpace(fmt.Sprintf("%s%s", usage, defaultVal)) - return fmt.Sprintf("%s\t%s", prefixedNames(name, placeholder), usageWithDefault) -} diff --git a/vendor/github.com/urfave/cli/flag_generated.go b/vendor/github.com/urfave/cli/flag_generated.go deleted file mode 100644 index 491b619..0000000 --- a/vendor/github.com/urfave/cli/flag_generated.go +++ /dev/null @@ -1,627 +0,0 @@ -package cli - -import ( - "flag" - "strconv" - "time" -) - -// WARNING: This file is generated! - -// BoolFlag is a flag with type bool -type BoolFlag struct { - Name string - Usage string - EnvVar string - Hidden bool - Destination *bool -} - -// String returns a readable representation of this value -// (for usage defaults) -func (f BoolFlag) String() string { - return FlagStringer(f) -} - -// GetName returns the name of the flag -func (f BoolFlag) GetName() string { - return f.Name -} - -// Bool looks up the value of a local BoolFlag, returns -// false if not found -func (c *Context) Bool(name string) bool { - return lookupBool(name, c.flagSet) -} - -// GlobalBool looks up the value of a global BoolFlag, returns -// false if not found -func (c *Context) GlobalBool(name string) bool { - if fs := lookupGlobalFlagSet(name, c); fs != nil { - return lookupBool(name, fs) - } - return false -} - -func lookupBool(name string, set *flag.FlagSet) bool { - f := set.Lookup(name) - if f != nil { - parsed, err := strconv.ParseBool(f.Value.String()) - if err != nil { - return false - } - return parsed - } - return false -} - -// BoolTFlag is a flag with type bool that is true by default -type BoolTFlag struct { - Name string - Usage string - EnvVar string - Hidden bool - Destination *bool -} - -// String returns a readable representation of this value -// (for usage defaults) -func (f BoolTFlag) String() string { - return FlagStringer(f) -} - -// GetName returns the name of the flag -func (f BoolTFlag) GetName() string { - return f.Name -} - -// BoolT looks up the value of a local BoolTFlag, returns -// false if not found -func (c *Context) BoolT(name string) bool { - return lookupBoolT(name, c.flagSet) -} - -// GlobalBoolT looks up the value of a global BoolTFlag, returns -// false if not found -func (c *Context) GlobalBoolT(name string) bool { - if fs := lookupGlobalFlagSet(name, c); fs != nil { - return lookupBoolT(name, fs) - } - return false -} - -func lookupBoolT(name string, set *flag.FlagSet) bool { - f := set.Lookup(name) - if f != nil { - parsed, err := strconv.ParseBool(f.Value.String()) - if err != nil { - return false - } - return parsed - } - return false -} - -// DurationFlag is a flag with type time.Duration (see https://golang.org/pkg/time/#ParseDuration) -type DurationFlag struct { - Name string - Usage string - EnvVar string - Hidden bool - Value time.Duration - Destination *time.Duration -} - -// String returns a readable representation of this value -// (for usage defaults) -func (f DurationFlag) String() string { - return FlagStringer(f) -} - -// GetName returns the name of the flag -func (f DurationFlag) GetName() string { - return f.Name -} - -// Duration looks up the value of a local DurationFlag, returns -// 0 if not found -func (c *Context) Duration(name string) time.Duration { - return lookupDuration(name, c.flagSet) -} - -// GlobalDuration looks up the value of a global DurationFlag, returns -// 0 if not found -func (c *Context) GlobalDuration(name string) time.Duration { - if fs := lookupGlobalFlagSet(name, c); fs != nil { - return lookupDuration(name, fs) - } - return 0 -} - -func lookupDuration(name string, set *flag.FlagSet) time.Duration { - f := set.Lookup(name) - if f != nil { - parsed, err := time.ParseDuration(f.Value.String()) - if err != nil { - return 0 - } - return parsed - } - return 0 -} - -// Float64Flag is a flag with type float64 -type Float64Flag struct { - Name string - Usage string - EnvVar string - Hidden bool - Value float64 - Destination *float64 -} - -// String returns a readable representation of this value -// (for usage defaults) -func (f Float64Flag) String() string { - return FlagStringer(f) -} - -// GetName returns the name of the flag -func (f Float64Flag) GetName() string { - return f.Name -} - -// Float64 looks up the value of a local Float64Flag, returns -// 0 if not found -func (c *Context) Float64(name string) float64 { - return lookupFloat64(name, c.flagSet) -} - -// GlobalFloat64 looks up the value of a global Float64Flag, returns -// 0 if not found -func (c *Context) GlobalFloat64(name string) float64 { - if fs := lookupGlobalFlagSet(name, c); fs != nil { - return lookupFloat64(name, fs) - } - return 0 -} - -func lookupFloat64(name string, set *flag.FlagSet) float64 { - f := set.Lookup(name) - if f != nil { - parsed, err := strconv.ParseFloat(f.Value.String(), 64) - if err != nil { - return 0 - } - return parsed - } - return 0 -} - -// GenericFlag is a flag with type Generic -type GenericFlag struct { - Name string - Usage string - EnvVar string - Hidden bool - Value Generic -} - -// String returns a readable representation of this value -// (for usage defaults) -func (f GenericFlag) String() string { - return FlagStringer(f) -} - -// GetName returns the name of the flag -func (f GenericFlag) GetName() string { - return f.Name -} - -// Generic looks up the value of a local GenericFlag, returns -// nil if not found -func (c *Context) Generic(name string) interface{} { - return lookupGeneric(name, c.flagSet) -} - -// GlobalGeneric looks up the value of a global GenericFlag, returns -// nil if not found -func (c *Context) GlobalGeneric(name string) interface{} { - if fs := lookupGlobalFlagSet(name, c); fs != nil { - return lookupGeneric(name, fs) - } - return nil -} - -func lookupGeneric(name string, set *flag.FlagSet) interface{} { - f := set.Lookup(name) - if f != nil { - parsed, err := f.Value, error(nil) - if err != nil { - return nil - } - return parsed - } - return nil -} - -// Int64Flag is a flag with type int64 -type Int64Flag struct { - Name string - Usage string - EnvVar string - Hidden bool - Value int64 - Destination *int64 -} - -// String returns a readable representation of this value -// (for usage defaults) -func (f Int64Flag) String() string { - return FlagStringer(f) -} - -// GetName returns the name of the flag -func (f Int64Flag) GetName() string { - return f.Name -} - -// Int64 looks up the value of a local Int64Flag, returns -// 0 if not found -func (c *Context) Int64(name string) int64 { - return lookupInt64(name, c.flagSet) -} - -// GlobalInt64 looks up the value of a global Int64Flag, returns -// 0 if not found -func (c *Context) GlobalInt64(name string) int64 { - if fs := lookupGlobalFlagSet(name, c); fs != nil { - return lookupInt64(name, fs) - } - return 0 -} - -func lookupInt64(name string, set *flag.FlagSet) int64 { - f := set.Lookup(name) - if f != nil { - parsed, err := strconv.ParseInt(f.Value.String(), 0, 64) - if err != nil { - return 0 - } - return parsed - } - return 0 -} - -// IntFlag is a flag with type int -type IntFlag struct { - Name string - Usage string - EnvVar string - Hidden bool - Value int - Destination *int -} - -// String returns a readable representation of this value -// (for usage defaults) -func (f IntFlag) String() string { - return FlagStringer(f) -} - -// GetName returns the name of the flag -func (f IntFlag) GetName() string { - return f.Name -} - -// Int looks up the value of a local IntFlag, returns -// 0 if not found -func (c *Context) Int(name string) int { - return lookupInt(name, c.flagSet) -} - -// GlobalInt looks up the value of a global IntFlag, returns -// 0 if not found -func (c *Context) GlobalInt(name string) int { - if fs := lookupGlobalFlagSet(name, c); fs != nil { - return lookupInt(name, fs) - } - return 0 -} - -func lookupInt(name string, set *flag.FlagSet) int { - f := set.Lookup(name) - if f != nil { - parsed, err := strconv.ParseInt(f.Value.String(), 0, 64) - if err != nil { - return 0 - } - return int(parsed) - } - return 0 -} - -// IntSliceFlag is a flag with type *IntSlice -type IntSliceFlag struct { - Name string - Usage string - EnvVar string - Hidden bool - Value *IntSlice -} - -// String returns a readable representation of this value -// (for usage defaults) -func (f IntSliceFlag) String() string { - return FlagStringer(f) -} - -// GetName returns the name of the flag -func (f IntSliceFlag) GetName() string { - return f.Name -} - -// IntSlice looks up the value of a local IntSliceFlag, returns -// nil if not found -func (c *Context) IntSlice(name string) []int { - return lookupIntSlice(name, c.flagSet) -} - -// GlobalIntSlice looks up the value of a global IntSliceFlag, returns -// nil if not found -func (c *Context) GlobalIntSlice(name string) []int { - if fs := lookupGlobalFlagSet(name, c); fs != nil { - return lookupIntSlice(name, fs) - } - return nil -} - -func lookupIntSlice(name string, set *flag.FlagSet) []int { - f := set.Lookup(name) - if f != nil { - parsed, err := (f.Value.(*IntSlice)).Value(), error(nil) - if err != nil { - return nil - } - return parsed - } - return nil -} - -// Int64SliceFlag is a flag with type *Int64Slice -type Int64SliceFlag struct { - Name string - Usage string - EnvVar string - Hidden bool - Value *Int64Slice -} - -// String returns a readable representation of this value -// (for usage defaults) -func (f Int64SliceFlag) String() string { - return FlagStringer(f) -} - -// GetName returns the name of the flag -func (f Int64SliceFlag) GetName() string { - return f.Name -} - -// Int64Slice looks up the value of a local Int64SliceFlag, returns -// nil if not found -func (c *Context) Int64Slice(name string) []int64 { - return lookupInt64Slice(name, c.flagSet) -} - -// GlobalInt64Slice looks up the value of a global Int64SliceFlag, returns -// nil if not found -func (c *Context) GlobalInt64Slice(name string) []int64 { - if fs := lookupGlobalFlagSet(name, c); fs != nil { - return lookupInt64Slice(name, fs) - } - return nil -} - -func lookupInt64Slice(name string, set *flag.FlagSet) []int64 { - f := set.Lookup(name) - if f != nil { - parsed, err := (f.Value.(*Int64Slice)).Value(), error(nil) - if err != nil { - return nil - } - return parsed - } - return nil -} - -// StringFlag is a flag with type string -type StringFlag struct { - Name string - Usage string - EnvVar string - Hidden bool - Value string - Destination *string -} - -// String returns a readable representation of this value -// (for usage defaults) -func (f StringFlag) String() string { - return FlagStringer(f) -} - -// GetName returns the name of the flag -func (f StringFlag) GetName() string { - return f.Name -} - -// String looks up the value of a local StringFlag, returns -// "" if not found -func (c *Context) String(name string) string { - return lookupString(name, c.flagSet) -} - -// GlobalString looks up the value of a global StringFlag, returns -// "" if not found -func (c *Context) GlobalString(name string) string { - if fs := lookupGlobalFlagSet(name, c); fs != nil { - return lookupString(name, fs) - } - return "" -} - -func lookupString(name string, set *flag.FlagSet) string { - f := set.Lookup(name) - if f != nil { - parsed, err := f.Value.String(), error(nil) - if err != nil { - return "" - } - return parsed - } - return "" -} - -// StringSliceFlag is a flag with type *StringSlice -type StringSliceFlag struct { - Name string - Usage string - EnvVar string - Hidden bool - Value *StringSlice -} - -// String returns a readable representation of this value -// (for usage defaults) -func (f StringSliceFlag) String() string { - return FlagStringer(f) -} - -// GetName returns the name of the flag -func (f StringSliceFlag) GetName() string { - return f.Name -} - -// StringSlice looks up the value of a local StringSliceFlag, returns -// nil if not found -func (c *Context) StringSlice(name string) []string { - return lookupStringSlice(name, c.flagSet) -} - -// GlobalStringSlice looks up the value of a global StringSliceFlag, returns -// nil if not found -func (c *Context) GlobalStringSlice(name string) []string { - if fs := lookupGlobalFlagSet(name, c); fs != nil { - return lookupStringSlice(name, fs) - } - return nil -} - -func lookupStringSlice(name string, set *flag.FlagSet) []string { - f := set.Lookup(name) - if f != nil { - parsed, err := (f.Value.(*StringSlice)).Value(), error(nil) - if err != nil { - return nil - } - return parsed - } - return nil -} - -// Uint64Flag is a flag with type uint64 -type Uint64Flag struct { - Name string - Usage string - EnvVar string - Hidden bool - Value uint64 - Destination *uint64 -} - -// String returns a readable representation of this value -// (for usage defaults) -func (f Uint64Flag) String() string { - return FlagStringer(f) -} - -// GetName returns the name of the flag -func (f Uint64Flag) GetName() string { - return f.Name -} - -// Uint64 looks up the value of a local Uint64Flag, returns -// 0 if not found -func (c *Context) Uint64(name string) uint64 { - return lookupUint64(name, c.flagSet) -} - -// GlobalUint64 looks up the value of a global Uint64Flag, returns -// 0 if not found -func (c *Context) GlobalUint64(name string) uint64 { - if fs := lookupGlobalFlagSet(name, c); fs != nil { - return lookupUint64(name, fs) - } - return 0 -} - -func lookupUint64(name string, set *flag.FlagSet) uint64 { - f := set.Lookup(name) - if f != nil { - parsed, err := strconv.ParseUint(f.Value.String(), 0, 64) - if err != nil { - return 0 - } - return parsed - } - return 0 -} - -// UintFlag is a flag with type uint -type UintFlag struct { - Name string - Usage string - EnvVar string - Hidden bool - Value uint - Destination *uint -} - -// String returns a readable representation of this value -// (for usage defaults) -func (f UintFlag) String() string { - return FlagStringer(f) -} - -// GetName returns the name of the flag -func (f UintFlag) GetName() string { - return f.Name -} - -// Uint looks up the value of a local UintFlag, returns -// 0 if not found -func (c *Context) Uint(name string) uint { - return lookupUint(name, c.flagSet) -} - -// GlobalUint looks up the value of a global UintFlag, returns -// 0 if not found -func (c *Context) GlobalUint(name string) uint { - if fs := lookupGlobalFlagSet(name, c); fs != nil { - return lookupUint(name, fs) - } - return 0 -} - -func lookupUint(name string, set *flag.FlagSet) uint { - f := set.Lookup(name) - if f != nil { - parsed, err := strconv.ParseUint(f.Value.String(), 0, 64) - if err != nil { - return 0 - } - return uint(parsed) - } - return 0 -} diff --git a/vendor/github.com/urfave/cli/funcs.go b/vendor/github.com/urfave/cli/funcs.go deleted file mode 100644 index cba5e6c..0000000 --- a/vendor/github.com/urfave/cli/funcs.go +++ /dev/null @@ -1,28 +0,0 @@ -package cli - -// BashCompleteFunc is an action to execute when the bash-completion flag is set -type BashCompleteFunc func(*Context) - -// BeforeFunc is an action to execute before any subcommands are run, but after -// the context is ready if a non-nil error is returned, no subcommands are run -type BeforeFunc func(*Context) error - -// AfterFunc is an action to execute after any subcommands are run, but after the -// subcommand has finished it is run even if Action() panics -type AfterFunc func(*Context) error - -// ActionFunc is the action to execute when no subcommands are specified -type ActionFunc func(*Context) error - -// CommandNotFoundFunc is executed if the proper command cannot be found -type CommandNotFoundFunc func(*Context, string) - -// OnUsageErrorFunc is executed if an usage error occurs. This is useful for displaying -// customized usage error messages. This function is able to replace the -// original error messages. If this function is not set, the "Incorrect usage" -// is displayed and the execution is interrupted. -type OnUsageErrorFunc func(context *Context, err error, isSubcommand bool) error - -// FlagStringFunc is used by the help generation to display a flag, which is -// expected to be a single line. -type FlagStringFunc func(Flag) string diff --git a/vendor/github.com/urfave/cli/generate-flag-types b/vendor/github.com/urfave/cli/generate-flag-types deleted file mode 100755 index 7147381..0000000 --- a/vendor/github.com/urfave/cli/generate-flag-types +++ /dev/null @@ -1,255 +0,0 @@ -#!/usr/bin/env python -""" -The flag types that ship with the cli library have many things in common, and -so we can take advantage of the `go generate` command to create much of the -source code from a list of definitions. These definitions attempt to cover -the parts that vary between flag types, and should evolve as needed. - -An example of the minimum definition needed is: - - { - "name": "SomeType", - "type": "sometype", - "context_default": "nil" - } - -In this example, the code generated for the `cli` package will include a type -named `SomeTypeFlag` that is expected to wrap a value of type `sometype`. -Fetching values by name via `*cli.Context` will default to a value of `nil`. - -A more complete, albeit somewhat redundant, example showing all available -definition keys is: - - { - "name": "VeryMuchType", - "type": "*VeryMuchType", - "value": true, - "dest": false, - "doctail": " which really only wraps a []float64, oh well!", - "context_type": "[]float64", - "context_default": "nil", - "parser": "parseVeryMuchType(f.Value.String())", - "parser_cast": "[]float64(parsed)" - } - -The meaning of each field is as follows: - - name (string) - The type "name", which will be suffixed with - `Flag` when generating the type definition - for `cli` and the wrapper type for `altsrc` - type (string) - The type that the generated `Flag` type for `cli` - is expected to "contain" as its `.Value` member - value (bool) - Should the generated `cli` type have a `Value` - member? - dest (bool) - Should the generated `cli` type support a - destination pointer? - doctail (string) - Additional docs for the `cli` flag type comment - context_type (string) - The literal type used in the `*cli.Context` - reader func signature - context_default (string) - The literal value used as the default by the - `*cli.Context` reader funcs when no value is - present - parser (string) - Literal code used to parse the flag `f`, - expected to have a return signature of - (value, error) - parser_cast (string) - Literal code used to cast the `parsed` value - returned from the `parser` code -""" - -from __future__ import print_function, unicode_literals - -import argparse -import json -import os -import subprocess -import sys -import tempfile -import textwrap - - -class _FancyFormatter(argparse.ArgumentDefaultsHelpFormatter, - argparse.RawDescriptionHelpFormatter): - pass - - -def main(sysargs=sys.argv[:]): - parser = argparse.ArgumentParser( - description='Generate flag type code!', - formatter_class=_FancyFormatter) - parser.add_argument( - 'package', - type=str, default='cli', choices=_WRITEFUNCS.keys(), - help='Package for which flag types will be generated' - ) - parser.add_argument( - '-i', '--in-json', - type=argparse.FileType('r'), - default=sys.stdin, - help='Input JSON file which defines each type to be generated' - ) - parser.add_argument( - '-o', '--out-go', - type=argparse.FileType('w'), - default=sys.stdout, - help='Output file/stream to which generated source will be written' - ) - parser.epilog = __doc__ - - args = parser.parse_args(sysargs[1:]) - _generate_flag_types(_WRITEFUNCS[args.package], args.out_go, args.in_json) - return 0 - - -def _generate_flag_types(writefunc, output_go, input_json): - types = json.load(input_json) - - tmp = tempfile.NamedTemporaryFile(suffix='.go', delete=False) - writefunc(tmp, types) - tmp.close() - - new_content = subprocess.check_output( - ['goimports', tmp.name] - ).decode('utf-8') - - print(new_content, file=output_go, end='') - output_go.flush() - os.remove(tmp.name) - - -def _set_typedef_defaults(typedef): - typedef.setdefault('doctail', '') - typedef.setdefault('context_type', typedef['type']) - typedef.setdefault('dest', True) - typedef.setdefault('value', True) - typedef.setdefault('parser', 'f.Value, error(nil)') - typedef.setdefault('parser_cast', 'parsed') - - -def _write_cli_flag_types(outfile, types): - _fwrite(outfile, """\ - package cli - - // WARNING: This file is generated! - - """) - - for typedef in types: - _set_typedef_defaults(typedef) - - _fwrite(outfile, """\ - // {name}Flag is a flag with type {type}{doctail} - type {name}Flag struct {{ - Name string - Usage string - EnvVar string - Hidden bool - """.format(**typedef)) - - if typedef['value']: - _fwrite(outfile, """\ - Value {type} - """.format(**typedef)) - - if typedef['dest']: - _fwrite(outfile, """\ - Destination *{type} - """.format(**typedef)) - - _fwrite(outfile, "\n}\n\n") - - _fwrite(outfile, """\ - // String returns a readable representation of this value - // (for usage defaults) - func (f {name}Flag) String() string {{ - return FlagStringer(f) - }} - - // GetName returns the name of the flag - func (f {name}Flag) GetName() string {{ - return f.Name - }} - - // {name} looks up the value of a local {name}Flag, returns - // {context_default} if not found - func (c *Context) {name}(name string) {context_type} {{ - return lookup{name}(name, c.flagSet) - }} - - // Global{name} looks up the value of a global {name}Flag, returns - // {context_default} if not found - func (c *Context) Global{name}(name string) {context_type} {{ - if fs := lookupGlobalFlagSet(name, c); fs != nil {{ - return lookup{name}(name, fs) - }} - return {context_default} - }} - - func lookup{name}(name string, set *flag.FlagSet) {context_type} {{ - f := set.Lookup(name) - if f != nil {{ - parsed, err := {parser} - if err != nil {{ - return {context_default} - }} - return {parser_cast} - }} - return {context_default} - }} - """.format(**typedef)) - - -def _write_altsrc_flag_types(outfile, types): - _fwrite(outfile, """\ - package altsrc - - import ( - "gopkg.in/urfave/cli.v1" - ) - - // WARNING: This file is generated! - - """) - - for typedef in types: - _set_typedef_defaults(typedef) - - _fwrite(outfile, """\ - // {name}Flag is the flag type that wraps cli.{name}Flag to allow - // for other values to be specified - type {name}Flag struct {{ - cli.{name}Flag - set *flag.FlagSet - }} - - // New{name}Flag creates a new {name}Flag - func New{name}Flag(fl cli.{name}Flag) *{name}Flag {{ - return &{name}Flag{{{name}Flag: fl, set: nil}} - }} - - // Apply saves the flagSet for later usage calls, then calls the - // wrapped {name}Flag.Apply - func (f *{name}Flag) Apply(set *flag.FlagSet) {{ - f.set = set - f.{name}Flag.Apply(set) - }} - - // ApplyWithError saves the flagSet for later usage calls, then calls the - // wrapped {name}Flag.ApplyWithError - func (f *{name}Flag) ApplyWithError(set *flag.FlagSet) error {{ - f.set = set - return f.{name}Flag.ApplyWithError(set) - }} - """.format(**typedef)) - - -def _fwrite(outfile, text): - print(textwrap.dedent(text), end='', file=outfile) - - -_WRITEFUNCS = { - 'cli': _write_cli_flag_types, - 'altsrc': _write_altsrc_flag_types -} - -if __name__ == '__main__': - sys.exit(main()) diff --git a/vendor/github.com/urfave/cli/help.go b/vendor/github.com/urfave/cli/help.go deleted file mode 100644 index 57ec98d..0000000 --- a/vendor/github.com/urfave/cli/help.go +++ /dev/null @@ -1,338 +0,0 @@ -package cli - -import ( - "fmt" - "io" - "os" - "strings" - "text/tabwriter" - "text/template" -) - -// AppHelpTemplate is the text template for the Default help topic. -// cli.go uses text/template to render templates. You can -// render custom help text by setting this variable. -var AppHelpTemplate = `NAME: - {{.Name}}{{if .Usage}} - {{.Usage}}{{end}} - -USAGE: - {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Version}}{{if not .HideVersion}} - -VERSION: - {{.Version}}{{end}}{{end}}{{if .Description}} - -DESCRIPTION: - {{.Description}}{{end}}{{if len .Authors}} - -AUTHOR{{with $length := len .Authors}}{{if ne 1 $length}}S{{end}}{{end}}: - {{range $index, $author := .Authors}}{{if $index}} - {{end}}{{$author}}{{end}}{{end}}{{if .VisibleCommands}} - -COMMANDS:{{range .VisibleCategories}}{{if .Name}} - {{.Name}}:{{end}}{{range .VisibleCommands}} - {{join .Names ", "}}{{"\t"}}{{.Usage}}{{end}}{{end}}{{end}}{{if .VisibleFlags}} - -GLOBAL OPTIONS: - {{range $index, $option := .VisibleFlags}}{{if $index}} - {{end}}{{$option}}{{end}}{{end}}{{if .Copyright}} - -COPYRIGHT: - {{.Copyright}}{{end}} -` - -// CommandHelpTemplate is the text template for the command help topic. -// cli.go uses text/template to render templates. You can -// render custom help text by setting this variable. -var CommandHelpTemplate = `NAME: - {{.HelpName}} - {{.Usage}} - -USAGE: - {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}}{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Category}} - -CATEGORY: - {{.Category}}{{end}}{{if .Description}} - -DESCRIPTION: - {{.Description}}{{end}}{{if .VisibleFlags}} - -OPTIONS: - {{range .VisibleFlags}}{{.}} - {{end}}{{end}} -` - -// SubcommandHelpTemplate is the text template for the subcommand help topic. -// cli.go uses text/template to render templates. You can -// render custom help text by setting this variable. -var SubcommandHelpTemplate = `NAME: - {{.HelpName}} - {{if .Description}}{{.Description}}{{else}}{{.Usage}}{{end}} - -USAGE: - {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}} - -COMMANDS:{{range .VisibleCategories}}{{if .Name}} - {{.Name}}:{{end}}{{range .VisibleCommands}} - {{join .Names ", "}}{{"\t"}}{{.Usage}}{{end}} -{{end}}{{if .VisibleFlags}} -OPTIONS: - {{range .VisibleFlags}}{{.}} - {{end}}{{end}} -` - -var helpCommand = Command{ - Name: "help", - Aliases: []string{"h"}, - Usage: "Shows a list of commands or help for one command", - ArgsUsage: "[command]", - Action: func(c *Context) error { - args := c.Args() - if args.Present() { - return ShowCommandHelp(c, args.First()) - } - - ShowAppHelp(c) - return nil - }, -} - -var helpSubcommand = Command{ - Name: "help", - Aliases: []string{"h"}, - Usage: "Shows a list of commands or help for one command", - ArgsUsage: "[command]", - Action: func(c *Context) error { - args := c.Args() - if args.Present() { - return ShowCommandHelp(c, args.First()) - } - - return ShowSubcommandHelp(c) - }, -} - -// Prints help for the App or Command -type helpPrinter func(w io.Writer, templ string, data interface{}) - -// Prints help for the App or Command with custom template function. -type helpPrinterCustom func(w io.Writer, templ string, data interface{}, customFunc map[string]interface{}) - -// HelpPrinter is a function that writes the help output. If not set a default -// is used. The function signature is: -// func(w io.Writer, templ string, data interface{}) -var HelpPrinter helpPrinter = printHelp - -// HelpPrinterCustom is same as HelpPrinter but -// takes a custom function for template function map. -var HelpPrinterCustom helpPrinterCustom = printHelpCustom - -// VersionPrinter prints the version for the App -var VersionPrinter = printVersion - -// ShowAppHelpAndExit - Prints the list of subcommands for the app and exits with exit code. -func ShowAppHelpAndExit(c *Context, exitCode int) { - ShowAppHelp(c) - os.Exit(exitCode) -} - -// ShowAppHelp is an action that displays the help. -func ShowAppHelp(c *Context) (err error) { - if c.App.CustomAppHelpTemplate == "" { - HelpPrinter(c.App.Writer, AppHelpTemplate, c.App) - return - } - customAppData := func() map[string]interface{} { - if c.App.ExtraInfo == nil { - return nil - } - return map[string]interface{}{ - "ExtraInfo": c.App.ExtraInfo, - } - } - HelpPrinterCustom(c.App.Writer, c.App.CustomAppHelpTemplate, c.App, customAppData()) - return nil -} - -// DefaultAppComplete prints the list of subcommands as the default app completion method -func DefaultAppComplete(c *Context) { - for _, command := range c.App.Commands { - if command.Hidden { - continue - } - for _, name := range command.Names() { - fmt.Fprintln(c.App.Writer, name) - } - } -} - -// ShowCommandHelpAndExit - exits with code after showing help -func ShowCommandHelpAndExit(c *Context, command string, code int) { - ShowCommandHelp(c, command) - os.Exit(code) -} - -// ShowCommandHelp prints help for the given command -func ShowCommandHelp(ctx *Context, command string) error { - // show the subcommand help for a command with subcommands - if command == "" { - HelpPrinter(ctx.App.Writer, SubcommandHelpTemplate, ctx.App) - return nil - } - - for _, c := range ctx.App.Commands { - if c.HasName(command) { - if c.CustomHelpTemplate != "" { - HelpPrinterCustom(ctx.App.Writer, c.CustomHelpTemplate, c, nil) - } else { - HelpPrinter(ctx.App.Writer, CommandHelpTemplate, c) - } - return nil - } - } - - if ctx.App.CommandNotFound == nil { - return NewExitError(fmt.Sprintf("No help topic for '%v'", command), 3) - } - - ctx.App.CommandNotFound(ctx, command) - return nil -} - -// ShowSubcommandHelp prints help for the given subcommand -func ShowSubcommandHelp(c *Context) error { - return ShowCommandHelp(c, c.Command.Name) -} - -// ShowVersion prints the version number of the App -func ShowVersion(c *Context) { - VersionPrinter(c) -} - -func printVersion(c *Context) { - fmt.Fprintf(c.App.Writer, "%v version %v\n", c.App.Name, c.App.Version) -} - -// ShowCompletions prints the lists of commands within a given context -func ShowCompletions(c *Context) { - a := c.App - if a != nil && a.BashComplete != nil { - a.BashComplete(c) - } -} - -// ShowCommandCompletions prints the custom completions for a given command -func ShowCommandCompletions(ctx *Context, command string) { - c := ctx.App.Command(command) - if c != nil && c.BashComplete != nil { - c.BashComplete(ctx) - } -} - -func printHelpCustom(out io.Writer, templ string, data interface{}, customFunc map[string]interface{}) { - funcMap := template.FuncMap{ - "join": strings.Join, - } - if customFunc != nil { - for key, value := range customFunc { - funcMap[key] = value - } - } - - w := tabwriter.NewWriter(out, 1, 8, 2, ' ', 0) - t := template.Must(template.New("help").Funcs(funcMap).Parse(templ)) - err := t.Execute(w, data) - if err != nil { - // If the writer is closed, t.Execute will fail, and there's nothing - // we can do to recover. - if os.Getenv("CLI_TEMPLATE_ERROR_DEBUG") != "" { - fmt.Fprintf(ErrWriter, "CLI TEMPLATE ERROR: %#v\n", err) - } - return - } - w.Flush() -} - -func printHelp(out io.Writer, templ string, data interface{}) { - printHelpCustom(out, templ, data, nil) -} - -func checkVersion(c *Context) bool { - found := false - if VersionFlag.GetName() != "" { - eachName(VersionFlag.GetName(), func(name string) { - if c.GlobalBool(name) || c.Bool(name) { - found = true - } - }) - } - return found -} - -func checkHelp(c *Context) bool { - found := false - if HelpFlag.GetName() != "" { - eachName(HelpFlag.GetName(), func(name string) { - if c.GlobalBool(name) || c.Bool(name) { - found = true - } - }) - } - return found -} - -func checkCommandHelp(c *Context, name string) bool { - if c.Bool("h") || c.Bool("help") { - ShowCommandHelp(c, name) - return true - } - - return false -} - -func checkSubcommandHelp(c *Context) bool { - if c.Bool("h") || c.Bool("help") { - ShowSubcommandHelp(c) - return true - } - - return false -} - -func checkShellCompleteFlag(a *App, arguments []string) (bool, []string) { - if !a.EnableBashCompletion { - return false, arguments - } - - pos := len(arguments) - 1 - lastArg := arguments[pos] - - if lastArg != "--"+BashCompletionFlag.GetName() { - return false, arguments - } - - return true, arguments[:pos] -} - -func checkCompletions(c *Context) bool { - if !c.shellComplete { - return false - } - - if args := c.Args(); args.Present() { - name := args.First() - if cmd := c.App.Command(name); cmd != nil { - // let the command handle the completion - return false - } - } - - ShowCompletions(c) - return true -} - -func checkCommandCompletions(c *Context, name string) bool { - if !c.shellComplete { - return false - } - - ShowCommandCompletions(c, name) - return true -} diff --git a/vendor/github.com/urfave/cli/runtests b/vendor/github.com/urfave/cli/runtests deleted file mode 100755 index ee22bde..0000000 --- a/vendor/github.com/urfave/cli/runtests +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/env python -from __future__ import print_function - -import argparse -import os -import sys -import tempfile - -from subprocess import check_call, check_output - - -PACKAGE_NAME = os.environ.get( - 'CLI_PACKAGE_NAME', 'github.com/urfave/cli' -) - - -def main(sysargs=sys.argv[:]): - targets = { - 'vet': _vet, - 'test': _test, - 'gfmrun': _gfmrun, - 'toc': _toc, - 'gen': _gen, - } - - parser = argparse.ArgumentParser() - parser.add_argument( - 'target', nargs='?', choices=tuple(targets.keys()), default='test' - ) - args = parser.parse_args(sysargs[1:]) - - targets[args.target]() - return 0 - - -def _test(): - if check_output('go version'.split()).split()[2] < 'go1.2': - _run('go test -v .') - return - - coverprofiles = [] - for subpackage in ['', 'altsrc']: - coverprofile = 'cli.coverprofile' - if subpackage != '': - coverprofile = '{}.coverprofile'.format(subpackage) - - coverprofiles.append(coverprofile) - - _run('go test -v'.split() + [ - '-coverprofile={}'.format(coverprofile), - ('{}/{}'.format(PACKAGE_NAME, subpackage)).rstrip('/') - ]) - - combined_name = _combine_coverprofiles(coverprofiles) - _run('go tool cover -func={}'.format(combined_name)) - os.remove(combined_name) - - -def _gfmrun(): - go_version = check_output('go version'.split()).split()[2] - if go_version < 'go1.3': - print('runtests: skip on {}'.format(go_version), file=sys.stderr) - return - _run(['gfmrun', '-c', str(_gfmrun_count()), '-s', 'README.md']) - - -def _vet(): - _run('go vet ./...') - - -def _toc(): - _run('node_modules/.bin/markdown-toc -i README.md') - _run('git diff --exit-code') - - -def _gen(): - go_version = check_output('go version'.split()).split()[2] - if go_version < 'go1.5': - print('runtests: skip on {}'.format(go_version), file=sys.stderr) - return - - _run('go generate ./...') - _run('git diff --exit-code') - - -def _run(command): - if hasattr(command, 'split'): - command = command.split() - print('runtests: {}'.format(' '.join(command)), file=sys.stderr) - check_call(command) - - -def _gfmrun_count(): - with open('README.md') as infile: - lines = infile.read().splitlines() - return len(filter(_is_go_runnable, lines)) - - -def _is_go_runnable(line): - return line.startswith('package main') - - -def _combine_coverprofiles(coverprofiles): - combined = tempfile.NamedTemporaryFile( - suffix='.coverprofile', delete=False - ) - combined.write('mode: set\n') - - for coverprofile in coverprofiles: - with open(coverprofile, 'r') as infile: - for line in infile.readlines(): - if not line.startswith('mode: '): - combined.write(line) - - combined.flush() - name = combined.name - combined.close() - return name - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/vendor/vendor.json b/vendor/vendor.json deleted file mode 100644 index e497bd5..0000000 --- a/vendor/vendor.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "comment": "", - "ignore": "test", - "package": [ - { - "checksumSHA1": "DWPL08pD/SQ2GzLfoR7ZXnjj7Sw=", - "path": "github.com/Sirupsen/logrus", - "revision": "4b6ea7319e214d98c938f12692336f7ca9348d6b", - "revisionTime": "2016-03-17T14:11:10Z" - }, - { - "checksumSHA1": "8KawKW6FJguwWz5cPvMg/ChmepE=", - "path": "github.com/gorilla/websocket", - "revision": "a69d9f6de432e2c6b296a947d8a5ee88f68522cf", - "revisionTime": "2017-07-18T20:23:41Z" - }, - { - "checksumSHA1": "rJab1YdNhQooDiBWNnt7TLWPyBU=", - "path": "github.com/pkg/errors", - "revision": "c605e284fe17294bda444b34710735b29d1a9d90", - "revisionTime": "2017-05-05T04:36:39Z" - }, - { - "checksumSHA1": "HAoxAuI1j65FTMunY578np6shdU=", - "path": "github.com/rancher/go-rancher/v2", - "revision": "52e2f489534007ae843065468c5a1920d542afa4", - "revisionTime": "2017-10-04T21:30:57Z" - }, - { - "checksumSHA1": "9LeR7BH4PSu8LRDZ8bY7QY1HXJE=", - "path": "github.com/urfave/cli", - "revision": "4b90d79a682b4bf685762c7452db20f2a676ecb2", - "revisionTime": "2017-07-06T19:46:25Z" - } - ], - "rootPath": "github.com/josmo/drone-rancher" -}