From 545e9b95d663c9a449d5ba89a531ded7c57d2de3 Mon Sep 17 00:00:00 2001 From: Richard Grainger Date: Wed, 6 Oct 2021 12:05:43 +0100 Subject: [PATCH] Update for harbor v2.3.3, add build script & swagger-codegen-cli conf --- .swagger-codegen/VERSION | 2 +- README.md | 260 +++++- docs/Access.md | 10 + docs/ArtifactApi.md | 78 +- docs/AuditlogApi.md | 4 +- docs/AuthproxySetting.md | 12 + docs/Body.md | 8 + docs/Body1.md | 8 + docs/BoolConfigItem.md | 9 + docs/ChartMetadata.md | 18 + docs/ChartVersion.md | 23 + docs/ComponentHealthStatus.md | 10 + docs/Configurations.md | 62 ++ docs/ConfigurationsResponse.md | 60 ++ docs/ConfigurationsResponseScanAllPolicy.md | 9 + ...gurationsResponseScanAllPolicyParameter.md | 8 + docs/ConfigureApi.md | 175 ++++ docs/Endpoint.md | 9 + docs/EventType.md | 7 + docs/FilterStyle.md | 10 + docs/GCHistory.md | 16 + docs/GcApi.md | 356 +++++++++ docs/GeneralInfo.md | 20 + docs/HealthApi.md | 63 ++ docs/ImmutableApi.md | 261 ++++++ docs/ImmutableRule.md | 15 + docs/ImmutableSelector.md | 11 + docs/IntegerConfigItem.md | 9 + docs/InternalConfigurationsResponse.md | 7 + docs/IsDefault.md | 8 + docs/LabelApi.md | 309 ++++++++ docs/LdapApi.md | 238 ++++++ docs/LdapConf.md | 16 + docs/LdapFailedImportUser.md | 9 + docs/LdapImportUsers.md | 8 + docs/LdapPingResult.md | 9 + docs/LdapUser.md | 10 + docs/MemberApi.md | 322 ++++++++ docs/NativeReportSummary.md | 1 + docs/NotifyType.md | 7 + docs/OIDCCliSecretReq.md | 8 + docs/OIDCUserInfo.md | 13 + docs/OidcApi.md | 65 ++ docs/OverallHealthStatus.md | 9 + docs/PasswordReq.md | 9 + docs/Permission.md | 9 + docs/PingApi.md | 63 ++ docs/PreheatApi.md | 16 +- docs/ProjectApi.md | 264 +++++- docs/ProjectMember.md | 10 + docs/ProjectMemberEntity.md | 14 + docs/ProjectMetadataApi.md | 318 ++++++++ docs/ProjectScanner.md | 8 + docs/Quota.md | 13 + docs/QuotaApi.md | 191 +++++ docs/QuotaRefObject.md | 7 + docs/QuotaUpdateReq.md | 8 + docs/Registry.md | 4 +- docs/RegistryApi.md | 530 +++++++++++++ docs/RegistryEndpoint.md | 9 + docs/RegistryInfo.md | 11 + docs/RegistryPing.md | 14 + docs/RegistryProviderCredentialPattern.md | 11 + docs/RegistryProviderEndpointPattern.md | 9 + docs/RegistryProviderInfo.md | 9 + docs/RegistryUpdate.md | 14 + docs/ReplicationApi.md | 673 ++++++++++++++++ docs/ReplicationExecution.md | 19 + docs/ReplicationFilter.md | 9 + docs/ReplicationPolicy.md | 22 + docs/ReplicationTask.md | 17 + docs/ReplicationTrigger.md | 9 + docs/ReplicationTriggerSettings.md | 8 + docs/RepositoryApi.md | 67 +- docs/RetentionApi.md | 609 ++++++++++++++ docs/RetentionExecution.md | 14 + docs/RetentionExecutionTask.md | 18 + docs/RetentionMetadata.md | 10 + docs/RetentionPolicy.md | 12 + docs/RetentionPolicyScope.md | 9 + docs/RetentionRule.md | 15 + docs/RetentionRuleMetadata.md | 11 + docs/RetentionRuleParamMetadata.md | 10 + docs/RetentionRuleTrigger.md | 10 + docs/RetentionSelector.md | 11 + docs/RetentionSelectorMetadata.md | 10 + docs/Robot.md | 19 + docs/RobotApi.md | 365 +++++++++ docs/RobotCreate.md | 14 + docs/RobotCreateV1.md | 11 + docs/RobotCreated.md | 12 + docs/RobotPermission.md | 10 + docs/RobotSec.md | 8 + docs/Robotv1Api.md | 329 ++++++++ docs/RoleRequest.md | 8 + docs/ScanAllApi.md | 287 +++++++ docs/Scanner.md | 10 + docs/ScannerAdapterMetadata.md | 10 + docs/ScannerApi.md | 479 +++++++++++ docs/ScannerCapability.md | 9 + docs/ScannerRegistration.md | 23 + docs/ScannerRegistrationReq.md | 15 + docs/ScannerRegistrationSettings.md | 11 + docs/Schedule.md | 13 + docs/ScheduleObj.md | 9 + docs/Search.md | 10 + docs/SearchApi.md | 66 ++ docs/SearchRepository.md | 13 + docs/SearchResult.md | 10 + docs/StartReplicationExecution.md | 8 + docs/Statistic.md | 14 + docs/StatisticApi.md | 63 ++ docs/Stats.md | 12 + docs/Storage.md | 9 + docs/StringConfigItem.md | 9 + docs/SupportedWebhookEventTypes.md | 9 + docs/SystemCVEAllowlistApi.md | 119 +++ docs/SystemInfo.md | 8 + docs/SysteminfoApi.md | 173 ++++ docs/UserApi.md | 647 +++++++++++++++ docs/UserCreationReq.md | 12 + docs/UserEntity.md | 9 + docs/UserGroup.md | 11 + docs/UserProfile.md | 10 + docs/UserResp.md | 17 + docs/UserSearch.md | 9 + docs/UserSearchRespItem.md | 9 + docs/UserSysAdminFlag.md | 8 + docs/UsergroupApi.md | 293 +++++++ docs/WebhookApi.md | 448 +++++++++++ docs/WebhookJob.md | 15 + docs/WebhookLastTrigger.md | 12 + docs/WebhookPolicy.md | 17 + docs/WebhookTargetObject.md | 11 + docs/WebhookjobApi.md | 81 ++ git_push.sh | 6 +- harbor2_client.gemspec | 14 +- lib/harbor2_client.rb | 128 ++- lib/harbor2_client/api/artifact_api.rb | 94 ++- lib/harbor2_client/api/auditlog_api.rb | 5 +- lib/harbor2_client/api/configure_api.rb | 193 +++++ lib/harbor2_client/api/gc_api.rb | 391 +++++++++ lib/harbor2_client/api/health_api.rb | 78 ++ lib/harbor2_client/api/icon_api.rb | 2 +- lib/harbor2_client/api/immutable_api.rb | 312 ++++++++ lib/harbor2_client/api/label_api.rb | 350 ++++++++ lib/harbor2_client/api/ldap_api.rb | 259 ++++++ lib/harbor2_client/api/member_api.rb | 373 +++++++++ lib/harbor2_client/api/oidc_api.rb | 83 ++ lib/harbor2_client/api/ping_api.rb | 78 ++ lib/harbor2_client/api/preheat_api.rb | 14 +- lib/harbor2_client/api/project_api.rb | 335 ++++++-- .../api/project_metadata_api.rb | 362 +++++++++ lib/harbor2_client/api/quota_api.rb | 224 ++++++ lib/harbor2_client/api/registry_api.rb | 575 ++++++++++++++ lib/harbor2_client/api/replication_api.rb | 749 ++++++++++++++++++ lib/harbor2_client/api/repository_api.rb | 76 +- lib/harbor2_client/api/retention_api.rb | 676 ++++++++++++++++ lib/harbor2_client/api/robot_api.rb | 409 ++++++++++ lib/harbor2_client/api/robotv1_api.rb | 387 +++++++++ lib/harbor2_client/api/scan_all_api.rb | 308 +++++++ lib/harbor2_client/api/scan_api.rb | 2 +- lib/harbor2_client/api/scanner_api.rb | 529 +++++++++++++ lib/harbor2_client/api/search_api.rb | 85 ++ lib/harbor2_client/api/statistic_api.rb | 78 ++ .../api/system_cve_allowlist_api.rb | 134 ++++ lib/harbor2_client/api/systeminfo_api.rb | 188 +++++ lib/harbor2_client/api/user_api.rb | 715 +++++++++++++++++ lib/harbor2_client/api/usergroup_api.rb | 317 ++++++++ lib/harbor2_client/api/webhook_api.rb | 514 ++++++++++++ lib/harbor2_client/api/webhookjob_api.rb | 113 +++ lib/harbor2_client/api_client.rb | 4 +- lib/harbor2_client/api_error.rb | 2 +- lib/harbor2_client/configuration.rb | 2 +- lib/harbor2_client/models/access.rb | 205 +++++ lib/harbor2_client/models/addition_link.rb | 2 +- lib/harbor2_client/models/addition_links.rb | 2 +- lib/harbor2_client/models/annotations.rb | 2 +- lib/harbor2_client/models/artifact.rb | 2 +- lib/harbor2_client/models/audit_log.rb | 2 +- .../models/authproxy_setting.rb | 225 ++++++ lib/harbor2_client/models/body.rb | 184 +++++ lib/harbor2_client/models/body_1.rb | 184 +++++ lib/harbor2_client/models/bool_config_item.rb | 195 +++++ lib/harbor2_client/models/chart_metadata.rb | 320 ++++++++ lib/harbor2_client/models/chart_version.rb | 374 +++++++++ .../models/component_health_status.rb | 206 +++++ lib/harbor2_client/models/configurations.rb | 725 +++++++++++++++++ .../models/configurations_response.rb | 704 ++++++++++++++++ ...configurations_response_scan_all_policy.rb | 194 +++++ ...ions_response_scan_all_policy_parameter.rb | 186 +++++ lib/harbor2_client/models/cve_allowlist.rb | 2 +- .../models/cve_allowlist_item.rb | 2 +- lib/harbor2_client/models/endpoint.rb | 195 +++++ lib/harbor2_client/models/error.rb | 2 +- lib/harbor2_client/models/errors.rb | 2 +- lib/harbor2_client/models/event_type.rb | 176 ++++ lib/harbor2_client/models/execution.rb | 2 +- lib/harbor2_client/models/extra_attrs.rb | 2 +- lib/harbor2_client/models/filter_style.rb | 208 +++++ lib/harbor2_client/models/gc_history.rb | 264 ++++++ lib/harbor2_client/models/general_info.rb | 305 +++++++ lib/harbor2_client/models/icon.rb | 2 +- lib/harbor2_client/models/immutable_rule.rb | 253 ++++++ .../models/immutable_selector.rb | 211 +++++ lib/harbor2_client/models/instance.rb | 2 +- .../models/integer_config_item.rb | 195 +++++ .../internal_configurations_response.rb | 175 ++++ lib/harbor2_client/models/is_default.rb | 185 +++++ lib/harbor2_client/models/label.rb | 2 +- lib/harbor2_client/models/ldap_conf.rb | 266 +++++++ .../models/ldap_failed_import_user.rb | 195 +++++ .../models/ldap_import_users.rb | 187 +++++ lib/harbor2_client/models/ldap_ping_result.rb | 196 +++++ lib/harbor2_client/models/ldap_user.rb | 205 +++++ lib/harbor2_client/models/metadata.rb | 2 +- lib/harbor2_client/models/metrics.rb | 2 +- .../models/native_report_summary.rb | 19 +- lib/harbor2_client/models/notify_type.rb | 176 ++++ .../models/oidc_cli_secret_req.rb | 185 +++++ lib/harbor2_client/models/oidc_user_info.rb | 235 ++++++ .../models/overall_health_status.rb | 197 +++++ lib/harbor2_client/models/password_req.rb | 195 +++++ lib/harbor2_client/models/permission.rb | 195 +++++ lib/harbor2_client/models/platform.rb | 14 +- lib/harbor2_client/models/preheat_policy.rb | 2 +- lib/harbor2_client/models/project.rb | 2 +- .../models/project_deletable.rb | 2 +- lib/harbor2_client/models/project_member.rb | 203 +++++ .../models/project_member_entity.rb | 245 ++++++ lib/harbor2_client/models/project_metadata.rb | 2 +- lib/harbor2_client/models/project_req.rb | 17 +- lib/harbor2_client/models/project_scanner.rb | 190 +++++ lib/harbor2_client/models/project_summary.rb | 2 +- .../models/project_summary_quota.rb | 2 +- .../models/provider_under_project.rb | 2 +- lib/harbor2_client/models/quota.rb | 236 ++++++ lib/harbor2_client/models/quota_ref_object.rb | 175 ++++ lib/harbor2_client/models/quota_update_req.rb | 185 +++++ lib/harbor2_client/models/reference.rb | 2 +- lib/harbor2_client/models/registry.rb | 6 +- .../models/registry_credential.rb | 2 +- .../models/registry_endpoint.rb | 196 +++++ lib/harbor2_client/models/registry_info.rb | 220 +++++ lib/harbor2_client/models/registry_ping.rb | 245 ++++++ .../registry_provider_credential_pattern.rb | 216 +++++ .../registry_provider_endpoint_pattern.rb | 198 +++++ .../models/registry_provider_info.rb | 196 +++++ lib/harbor2_client/models/registry_update.rb | 245 ++++++ .../models/replication_execution.rb | 296 +++++++ .../models/replication_filter.rb | 195 +++++ .../models/replication_policy.rb | 326 ++++++++ lib/harbor2_client/models/replication_task.rb | 276 +++++++ .../models/replication_trigger.rb | 194 +++++ .../models/replication_trigger_settings.rb | 185 +++++ lib/harbor2_client/models/repository.rb | 2 +- lib/harbor2_client/models/resource_list.rb | 2 +- .../models/retention_execution.rb | 238 ++++++ .../models/retention_execution_task.rb | 274 +++++++ .../models/retention_metadata.rb | 212 +++++ lib/harbor2_client/models/retention_policy.rb | 223 ++++++ .../models/retention_policy_scope.rb | 193 +++++ lib/harbor2_client/models/retention_rule.rb | 253 ++++++ .../models/retention_rule_metadata.rb | 218 +++++ .../models/retention_rule_param_metadata.rb | 203 +++++ .../models/retention_rule_trigger.rb | 202 +++++ .../models/retention_selector.rb | 211 +++++ .../models/retention_selector_metadata.rb | 205 +++++ lib/harbor2_client/models/robot.rb | 296 +++++++ lib/harbor2_client/models/robot_create.rb | 247 ++++++ lib/harbor2_client/models/robot_create_v1.rb | 217 +++++ lib/harbor2_client/models/robot_created.rb | 226 ++++++ lib/harbor2_client/models/robot_permission.rb | 206 +++++ lib/harbor2_client/models/robot_sec.rb | 186 +++++ lib/harbor2_client/models/role_request.rb | 185 +++++ lib/harbor2_client/models/scan_overview.rb | 2 +- lib/harbor2_client/models/scanner.rb | 205 +++++ .../models/scanner_adapter_metadata.rb | 207 +++++ .../models/scanner_capability.rb | 197 +++++ .../models/scanner_registration.rb | 348 ++++++++ .../models/scanner_registration_req.rb | 271 +++++++ .../models/scanner_registration_settings.rb | 227 ++++++ lib/harbor2_client/models/schedule.rb | 236 ++++++ lib/harbor2_client/models/schedule_obj.rb | 229 ++++++ lib/harbor2_client/models/search.rb | 211 +++++ .../models/search_repository.rb | 235 ++++++ lib/harbor2_client/models/search_result.rb | 205 +++++ .../models/start_replication_execution.rb | 185 +++++ lib/harbor2_client/models/statistic.rb | 245 ++++++ lib/harbor2_client/models/stats.rb | 262 ++++++ lib/harbor2_client/models/storage.rb | 195 +++++ .../models/string_config_item.rb | 195 +++++ .../models/supported_webhook_event_types.rb | 198 +++++ lib/harbor2_client/models/system_info.rb | 187 +++++ lib/harbor2_client/models/tag.rb | 2 +- lib/harbor2_client/models/task.rb | 2 +- .../models/user_creation_req.rb | 250 ++++++ lib/harbor2_client/models/user_entity.rb | 195 +++++ lib/harbor2_client/models/user_group.rb | 215 +++++ lib/harbor2_client/models/user_profile.rb | 202 +++++ lib/harbor2_client/models/user_resp.rb | 268 +++++++ lib/harbor2_client/models/user_search.rb | 194 +++++ .../models/user_search_resp_item.rb | 194 +++++ .../models/user_sys_admin_flag.rb | 185 +++++ .../models/vulnerability_summary.rb | 2 +- lib/harbor2_client/models/webhook_job.rb | 256 ++++++ .../models/webhook_last_trigger.rb | 226 ++++++ lib/harbor2_client/models/webhook_policy.rb | 278 +++++++ .../models/webhook_target_object.rb | 216 +++++ lib/harbor2_client/version.rb | 4 +- spec/api/artifact_api_spec.rb | 22 +- spec/api/auditlog_api_spec.rb | 3 +- spec/api/configure_api_spec.rb | 72 ++ spec/api/gc_api_spec.rb | 115 +++ spec/api/health_api_spec.rb | 47 ++ spec/api/icon_api_spec.rb | 2 +- spec/api/immutable_api_spec.rb | 97 +++ spec/api/label_api_spec.rb | 107 +++ spec/api/ldap_api_spec.rb | 88 ++ spec/api/member_api_spec.rb | 112 +++ spec/api/oidc_api_spec.rb | 48 ++ spec/api/ping_api_spec.rb | 47 ++ spec/api/preheat_api_spec.rb | 6 +- spec/api/project_api_spec.rb | 69 +- spec/api/project_metadata_api_spec.rb | 110 +++ spec/api/quota_api_spec.rb | 79 ++ spec/api/registry_api_spec.rb | 155 ++++ spec/api/replication_api_spec.rb | 194 +++++ spec/api/repository_api_spec.rb | 19 +- spec/api/retention_api_spec.rb | 175 ++++ spec/api/robot_api_spec.rb | 118 +++ spec/api/robotv1_api_spec.rb | 114 +++ spec/api/scan_all_api_spec.rb | 97 +++ spec/api/scan_api_spec.rb | 2 +- spec/api/scanner_api_spec.rb | 144 ++++ spec/api/search_api_spec.rb | 48 ++ spec/api/statistic_api_spec.rb | 47 ++ spec/api/system_cve_allowlist_api_spec.rb | 60 ++ spec/api/systeminfo_api_spec.rb | 71 ++ spec/api/user_api_spec.rb | 181 +++++ spec/api/usergroup_api_spec.rb | 100 +++ spec/api/webhook_api_spec.rb | 142 ++++ spec/api/webhookjob_api_spec.rb | 55 ++ spec/api_client_spec.rb | 2 +- spec/configuration_spec.rb | 2 +- spec/models/access_spec.rb | 53 ++ spec/models/addition_link_spec.rb | 2 +- spec/models/addition_links_spec.rb | 2 +- spec/models/annotations_spec.rb | 2 +- spec/models/artifact_spec.rb | 2 +- spec/models/audit_log_spec.rb | 2 +- spec/models/authproxy_setting_spec.rb | 65 ++ spec/models/body_1_spec.rb | 41 + spec/models/body_spec.rb | 41 + spec/models/bool_config_item_spec.rb | 47 ++ spec/models/chart_metadata_spec.rb | 101 +++ spec/models/chart_version_spec.rb | 131 +++ spec/models/component_health_status_spec.rb | 53 ++ ...response_scan_all_policy_parameter_spec.rb | 41 + ...gurations_response_scan_all_policy_spec.rb | 47 ++ spec/models/configurations_response_spec.rb | 353 +++++++++ spec/models/configurations_spec.rb | 365 +++++++++ spec/models/cve_allowlist_item_spec.rb | 2 +- spec/models/cve_allowlist_spec.rb | 2 +- spec/models/endpoint_spec.rb | 47 ++ spec/models/error_spec.rb | 2 +- spec/models/errors_spec.rb | 2 +- spec/models/event_type_spec.rb | 35 + spec/models/execution_spec.rb | 2 +- spec/models/extra_attrs_spec.rb | 2 +- spec/models/filter_style_spec.rb | 53 ++ spec/models/gc_history_spec.rb | 89 +++ spec/models/general_info_spec.rb | 113 +++ spec/models/icon_spec.rb | 2 +- spec/models/immutable_rule_spec.rb | 83 ++ spec/models/immutable_selector_spec.rb | 59 ++ spec/models/instance_spec.rb | 2 +- spec/models/integer_config_item_spec.rb | 47 ++ .../internal_configurations_response_spec.rb | 35 + spec/models/is_default_spec.rb | 41 + spec/models/label_spec.rb | 2 +- spec/models/ldap_conf_spec.rb | 89 +++ spec/models/ldap_failed_import_user_spec.rb | 47 ++ spec/models/ldap_import_users_spec.rb | 41 + spec/models/ldap_ping_result_spec.rb | 47 ++ spec/models/ldap_user_spec.rb | 53 ++ spec/models/metadata_spec.rb | 2 +- spec/models/metrics_spec.rb | 2 +- spec/models/native_report_summary_spec.rb | 8 +- spec/models/notify_type_spec.rb | 35 + spec/models/oidc_cli_secret_req_spec.rb | 41 + spec/models/oidc_user_info_spec.rb | 71 ++ spec/models/overall_health_status_spec.rb | 47 ++ spec/models/password_req_spec.rb | 47 ++ spec/models/permission_spec.rb | 47 ++ spec/models/platform_spec.rb | 2 +- spec/models/preheat_policy_spec.rb | 2 +- spec/models/project_deletable_spec.rb | 2 +- spec/models/project_member_entity_spec.rb | 77 ++ spec/models/project_member_spec.rb | 53 ++ spec/models/project_metadata_spec.rb | 2 +- spec/models/project_req_spec.rb | 2 +- spec/models/project_scanner_spec.rb | 41 + spec/models/project_spec.rb | 2 +- spec/models/project_summary_quota_spec.rb | 2 +- spec/models/project_summary_spec.rb | 2 +- spec/models/provider_under_project_spec.rb | 2 +- spec/models/quota_ref_object_spec.rb | 35 + spec/models/quota_spec.rb | 71 ++ spec/models/quota_update_req_spec.rb | 41 + spec/models/reference_spec.rb | 2 +- spec/models/registry_credential_spec.rb | 2 +- spec/models/registry_endpoint_spec.rb | 47 ++ spec/models/registry_info_spec.rb | 59 ++ spec/models/registry_ping_spec.rb | 77 ++ ...gistry_provider_credential_pattern_spec.rb | 59 ++ ...registry_provider_endpoint_pattern_spec.rb | 47 ++ spec/models/registry_provider_info_spec.rb | 47 ++ spec/models/registry_spec.rb | 2 +- spec/models/registry_update_spec.rb | 77 ++ spec/models/replication_execution_spec.rb | 107 +++ spec/models/replication_filter_spec.rb | 47 ++ spec/models/replication_policy_spec.rb | 125 +++ spec/models/replication_task_spec.rb | 95 +++ .../replication_trigger_settings_spec.rb | 41 + spec/models/replication_trigger_spec.rb | 47 ++ spec/models/repository_spec.rb | 2 +- spec/models/resource_list_spec.rb | 2 +- spec/models/retention_execution_spec.rb | 77 ++ spec/models/retention_execution_task_spec.rb | 101 +++ spec/models/retention_metadata_spec.rb | 53 ++ spec/models/retention_policy_scope_spec.rb | 47 ++ spec/models/retention_policy_spec.rb | 65 ++ spec/models/retention_rule_metadata_spec.rb | 59 ++ .../retention_rule_param_metadata_spec.rb | 53 ++ spec/models/retention_rule_spec.rb | 83 ++ spec/models/retention_rule_trigger_spec.rb | 53 ++ .../retention_selector_metadata_spec.rb | 53 ++ spec/models/retention_selector_spec.rb | 59 ++ spec/models/robot_create_spec.rb | 77 ++ spec/models/robot_create_v1_spec.rb | 59 ++ spec/models/robot_created_spec.rb | 65 ++ spec/models/robot_permission_spec.rb | 53 ++ spec/models/robot_sec_spec.rb | 41 + spec/models/robot_spec.rb | 107 +++ spec/models/role_request_spec.rb | 41 + spec/models/scan_overview_spec.rb | 2 +- spec/models/scanner_adapter_metadata_spec.rb | 53 ++ spec/models/scanner_capability_spec.rb | 47 ++ spec/models/scanner_registration_req_spec.rb | 83 ++ .../scanner_registration_settings_spec.rb | 59 ++ spec/models/scanner_registration_spec.rb | 131 +++ spec/models/scanner_spec.rb | 53 ++ spec/models/schedule_obj_spec.rb | 51 ++ spec/models/schedule_spec.rb | 71 ++ spec/models/search_repository_spec.rb | 71 ++ spec/models/search_result_spec.rb | 53 ++ spec/models/search_spec.rb | 53 ++ .../start_replication_execution_spec.rb | 41 + spec/models/statistic_spec.rb | 77 ++ spec/models/stats_spec.rb | 69 ++ spec/models/storage_spec.rb | 47 ++ spec/models/string_config_item_spec.rb | 47 ++ .../supported_webhook_event_types_spec.rb | 47 ++ spec/models/system_info_spec.rb | 41 + spec/models/tag_spec.rb | 2 +- spec/models/task_spec.rb | 2 +- spec/models/user_creation_req_spec.rb | 65 ++ spec/models/user_entity_spec.rb | 47 ++ spec/models/user_group_spec.rb | 59 ++ spec/models/user_profile_spec.rb | 53 ++ spec/models/user_resp_spec.rb | 95 +++ spec/models/user_search_resp_item_spec.rb | 47 ++ spec/models/user_search_spec.rb | 47 ++ spec/models/user_sys_admin_flag_spec.rb | 41 + spec/models/vulnerability_summary_spec.rb | 2 +- spec/models/webhook_job_spec.rb | 83 ++ spec/models/webhook_last_trigger_spec.rb | 65 ++ spec/models/webhook_policy_spec.rb | 95 +++ spec/models/webhook_target_object_spec.rb | 59 ++ spec/spec_helper.rb | 2 +- 481 files changed, 51068 insertions(+), 225 deletions(-) create mode 100644 docs/Access.md create mode 100644 docs/AuthproxySetting.md create mode 100644 docs/Body.md create mode 100644 docs/Body1.md create mode 100644 docs/BoolConfigItem.md create mode 100644 docs/ChartMetadata.md create mode 100644 docs/ChartVersion.md create mode 100644 docs/ComponentHealthStatus.md create mode 100644 docs/Configurations.md create mode 100644 docs/ConfigurationsResponse.md create mode 100644 docs/ConfigurationsResponseScanAllPolicy.md create mode 100644 docs/ConfigurationsResponseScanAllPolicyParameter.md create mode 100644 docs/ConfigureApi.md create mode 100644 docs/Endpoint.md create mode 100644 docs/EventType.md create mode 100644 docs/FilterStyle.md create mode 100644 docs/GCHistory.md create mode 100644 docs/GcApi.md create mode 100644 docs/GeneralInfo.md create mode 100644 docs/HealthApi.md create mode 100644 docs/ImmutableApi.md create mode 100644 docs/ImmutableRule.md create mode 100644 docs/ImmutableSelector.md create mode 100644 docs/IntegerConfigItem.md create mode 100644 docs/InternalConfigurationsResponse.md create mode 100644 docs/IsDefault.md create mode 100644 docs/LabelApi.md create mode 100644 docs/LdapApi.md create mode 100644 docs/LdapConf.md create mode 100644 docs/LdapFailedImportUser.md create mode 100644 docs/LdapImportUsers.md create mode 100644 docs/LdapPingResult.md create mode 100644 docs/LdapUser.md create mode 100644 docs/MemberApi.md create mode 100644 docs/NotifyType.md create mode 100644 docs/OIDCCliSecretReq.md create mode 100644 docs/OIDCUserInfo.md create mode 100644 docs/OidcApi.md create mode 100644 docs/OverallHealthStatus.md create mode 100644 docs/PasswordReq.md create mode 100644 docs/Permission.md create mode 100644 docs/PingApi.md create mode 100644 docs/ProjectMember.md create mode 100644 docs/ProjectMemberEntity.md create mode 100644 docs/ProjectMetadataApi.md create mode 100644 docs/ProjectScanner.md create mode 100644 docs/Quota.md create mode 100644 docs/QuotaApi.md create mode 100644 docs/QuotaRefObject.md create mode 100644 docs/QuotaUpdateReq.md create mode 100644 docs/RegistryApi.md create mode 100644 docs/RegistryEndpoint.md create mode 100644 docs/RegistryInfo.md create mode 100644 docs/RegistryPing.md create mode 100644 docs/RegistryProviderCredentialPattern.md create mode 100644 docs/RegistryProviderEndpointPattern.md create mode 100644 docs/RegistryProviderInfo.md create mode 100644 docs/RegistryUpdate.md create mode 100644 docs/ReplicationApi.md create mode 100644 docs/ReplicationExecution.md create mode 100644 docs/ReplicationFilter.md create mode 100644 docs/ReplicationPolicy.md create mode 100644 docs/ReplicationTask.md create mode 100644 docs/ReplicationTrigger.md create mode 100644 docs/ReplicationTriggerSettings.md create mode 100644 docs/RetentionApi.md create mode 100644 docs/RetentionExecution.md create mode 100644 docs/RetentionExecutionTask.md create mode 100644 docs/RetentionMetadata.md create mode 100644 docs/RetentionPolicy.md create mode 100644 docs/RetentionPolicyScope.md create mode 100644 docs/RetentionRule.md create mode 100644 docs/RetentionRuleMetadata.md create mode 100644 docs/RetentionRuleParamMetadata.md create mode 100644 docs/RetentionRuleTrigger.md create mode 100644 docs/RetentionSelector.md create mode 100644 docs/RetentionSelectorMetadata.md create mode 100644 docs/Robot.md create mode 100644 docs/RobotApi.md create mode 100644 docs/RobotCreate.md create mode 100644 docs/RobotCreateV1.md create mode 100644 docs/RobotCreated.md create mode 100644 docs/RobotPermission.md create mode 100644 docs/RobotSec.md create mode 100644 docs/Robotv1Api.md create mode 100644 docs/RoleRequest.md create mode 100644 docs/ScanAllApi.md create mode 100644 docs/Scanner.md create mode 100644 docs/ScannerAdapterMetadata.md create mode 100644 docs/ScannerApi.md create mode 100644 docs/ScannerCapability.md create mode 100644 docs/ScannerRegistration.md create mode 100644 docs/ScannerRegistrationReq.md create mode 100644 docs/ScannerRegistrationSettings.md create mode 100644 docs/Schedule.md create mode 100644 docs/ScheduleObj.md create mode 100644 docs/Search.md create mode 100644 docs/SearchApi.md create mode 100644 docs/SearchRepository.md create mode 100644 docs/SearchResult.md create mode 100644 docs/StartReplicationExecution.md create mode 100644 docs/Statistic.md create mode 100644 docs/StatisticApi.md create mode 100644 docs/Stats.md create mode 100644 docs/Storage.md create mode 100644 docs/StringConfigItem.md create mode 100644 docs/SupportedWebhookEventTypes.md create mode 100644 docs/SystemCVEAllowlistApi.md create mode 100644 docs/SystemInfo.md create mode 100644 docs/SysteminfoApi.md create mode 100644 docs/UserApi.md create mode 100644 docs/UserCreationReq.md create mode 100644 docs/UserEntity.md create mode 100644 docs/UserGroup.md create mode 100644 docs/UserProfile.md create mode 100644 docs/UserResp.md create mode 100644 docs/UserSearch.md create mode 100644 docs/UserSearchRespItem.md create mode 100644 docs/UserSysAdminFlag.md create mode 100644 docs/UsergroupApi.md create mode 100644 docs/WebhookApi.md create mode 100644 docs/WebhookJob.md create mode 100644 docs/WebhookLastTrigger.md create mode 100644 docs/WebhookPolicy.md create mode 100644 docs/WebhookTargetObject.md create mode 100644 docs/WebhookjobApi.md create mode 100644 lib/harbor2_client/api/configure_api.rb create mode 100644 lib/harbor2_client/api/gc_api.rb create mode 100644 lib/harbor2_client/api/health_api.rb create mode 100644 lib/harbor2_client/api/immutable_api.rb create mode 100644 lib/harbor2_client/api/label_api.rb create mode 100644 lib/harbor2_client/api/ldap_api.rb create mode 100644 lib/harbor2_client/api/member_api.rb create mode 100644 lib/harbor2_client/api/oidc_api.rb create mode 100644 lib/harbor2_client/api/ping_api.rb create mode 100644 lib/harbor2_client/api/project_metadata_api.rb create mode 100644 lib/harbor2_client/api/quota_api.rb create mode 100644 lib/harbor2_client/api/registry_api.rb create mode 100644 lib/harbor2_client/api/replication_api.rb create mode 100644 lib/harbor2_client/api/retention_api.rb create mode 100644 lib/harbor2_client/api/robot_api.rb create mode 100644 lib/harbor2_client/api/robotv1_api.rb create mode 100644 lib/harbor2_client/api/scan_all_api.rb create mode 100644 lib/harbor2_client/api/scanner_api.rb create mode 100644 lib/harbor2_client/api/search_api.rb create mode 100644 lib/harbor2_client/api/statistic_api.rb create mode 100644 lib/harbor2_client/api/system_cve_allowlist_api.rb create mode 100644 lib/harbor2_client/api/systeminfo_api.rb create mode 100644 lib/harbor2_client/api/user_api.rb create mode 100644 lib/harbor2_client/api/usergroup_api.rb create mode 100644 lib/harbor2_client/api/webhook_api.rb create mode 100644 lib/harbor2_client/api/webhookjob_api.rb create mode 100644 lib/harbor2_client/models/access.rb create mode 100644 lib/harbor2_client/models/authproxy_setting.rb create mode 100644 lib/harbor2_client/models/body.rb create mode 100644 lib/harbor2_client/models/body_1.rb create mode 100644 lib/harbor2_client/models/bool_config_item.rb create mode 100644 lib/harbor2_client/models/chart_metadata.rb create mode 100644 lib/harbor2_client/models/chart_version.rb create mode 100644 lib/harbor2_client/models/component_health_status.rb create mode 100644 lib/harbor2_client/models/configurations.rb create mode 100644 lib/harbor2_client/models/configurations_response.rb create mode 100644 lib/harbor2_client/models/configurations_response_scan_all_policy.rb create mode 100644 lib/harbor2_client/models/configurations_response_scan_all_policy_parameter.rb create mode 100644 lib/harbor2_client/models/endpoint.rb create mode 100644 lib/harbor2_client/models/event_type.rb create mode 100644 lib/harbor2_client/models/filter_style.rb create mode 100644 lib/harbor2_client/models/gc_history.rb create mode 100644 lib/harbor2_client/models/general_info.rb create mode 100644 lib/harbor2_client/models/immutable_rule.rb create mode 100644 lib/harbor2_client/models/immutable_selector.rb create mode 100644 lib/harbor2_client/models/integer_config_item.rb create mode 100644 lib/harbor2_client/models/internal_configurations_response.rb create mode 100644 lib/harbor2_client/models/is_default.rb create mode 100644 lib/harbor2_client/models/ldap_conf.rb create mode 100644 lib/harbor2_client/models/ldap_failed_import_user.rb create mode 100644 lib/harbor2_client/models/ldap_import_users.rb create mode 100644 lib/harbor2_client/models/ldap_ping_result.rb create mode 100644 lib/harbor2_client/models/ldap_user.rb create mode 100644 lib/harbor2_client/models/notify_type.rb create mode 100644 lib/harbor2_client/models/oidc_cli_secret_req.rb create mode 100644 lib/harbor2_client/models/oidc_user_info.rb create mode 100644 lib/harbor2_client/models/overall_health_status.rb create mode 100644 lib/harbor2_client/models/password_req.rb create mode 100644 lib/harbor2_client/models/permission.rb create mode 100644 lib/harbor2_client/models/project_member.rb create mode 100644 lib/harbor2_client/models/project_member_entity.rb create mode 100644 lib/harbor2_client/models/project_scanner.rb create mode 100644 lib/harbor2_client/models/quota.rb create mode 100644 lib/harbor2_client/models/quota_ref_object.rb create mode 100644 lib/harbor2_client/models/quota_update_req.rb create mode 100644 lib/harbor2_client/models/registry_endpoint.rb create mode 100644 lib/harbor2_client/models/registry_info.rb create mode 100644 lib/harbor2_client/models/registry_ping.rb create mode 100644 lib/harbor2_client/models/registry_provider_credential_pattern.rb create mode 100644 lib/harbor2_client/models/registry_provider_endpoint_pattern.rb create mode 100644 lib/harbor2_client/models/registry_provider_info.rb create mode 100644 lib/harbor2_client/models/registry_update.rb create mode 100644 lib/harbor2_client/models/replication_execution.rb create mode 100644 lib/harbor2_client/models/replication_filter.rb create mode 100644 lib/harbor2_client/models/replication_policy.rb create mode 100644 lib/harbor2_client/models/replication_task.rb create mode 100644 lib/harbor2_client/models/replication_trigger.rb create mode 100644 lib/harbor2_client/models/replication_trigger_settings.rb create mode 100644 lib/harbor2_client/models/retention_execution.rb create mode 100644 lib/harbor2_client/models/retention_execution_task.rb create mode 100644 lib/harbor2_client/models/retention_metadata.rb create mode 100644 lib/harbor2_client/models/retention_policy.rb create mode 100644 lib/harbor2_client/models/retention_policy_scope.rb create mode 100644 lib/harbor2_client/models/retention_rule.rb create mode 100644 lib/harbor2_client/models/retention_rule_metadata.rb create mode 100644 lib/harbor2_client/models/retention_rule_param_metadata.rb create mode 100644 lib/harbor2_client/models/retention_rule_trigger.rb create mode 100644 lib/harbor2_client/models/retention_selector.rb create mode 100644 lib/harbor2_client/models/retention_selector_metadata.rb create mode 100644 lib/harbor2_client/models/robot.rb create mode 100644 lib/harbor2_client/models/robot_create.rb create mode 100644 lib/harbor2_client/models/robot_create_v1.rb create mode 100644 lib/harbor2_client/models/robot_created.rb create mode 100644 lib/harbor2_client/models/robot_permission.rb create mode 100644 lib/harbor2_client/models/robot_sec.rb create mode 100644 lib/harbor2_client/models/role_request.rb create mode 100644 lib/harbor2_client/models/scanner.rb create mode 100644 lib/harbor2_client/models/scanner_adapter_metadata.rb create mode 100644 lib/harbor2_client/models/scanner_capability.rb create mode 100644 lib/harbor2_client/models/scanner_registration.rb create mode 100644 lib/harbor2_client/models/scanner_registration_req.rb create mode 100644 lib/harbor2_client/models/scanner_registration_settings.rb create mode 100644 lib/harbor2_client/models/schedule.rb create mode 100644 lib/harbor2_client/models/schedule_obj.rb create mode 100644 lib/harbor2_client/models/search.rb create mode 100644 lib/harbor2_client/models/search_repository.rb create mode 100644 lib/harbor2_client/models/search_result.rb create mode 100644 lib/harbor2_client/models/start_replication_execution.rb create mode 100644 lib/harbor2_client/models/statistic.rb create mode 100644 lib/harbor2_client/models/stats.rb create mode 100644 lib/harbor2_client/models/storage.rb create mode 100644 lib/harbor2_client/models/string_config_item.rb create mode 100644 lib/harbor2_client/models/supported_webhook_event_types.rb create mode 100644 lib/harbor2_client/models/system_info.rb create mode 100644 lib/harbor2_client/models/user_creation_req.rb create mode 100644 lib/harbor2_client/models/user_entity.rb create mode 100644 lib/harbor2_client/models/user_group.rb create mode 100644 lib/harbor2_client/models/user_profile.rb create mode 100644 lib/harbor2_client/models/user_resp.rb create mode 100644 lib/harbor2_client/models/user_search.rb create mode 100644 lib/harbor2_client/models/user_search_resp_item.rb create mode 100644 lib/harbor2_client/models/user_sys_admin_flag.rb create mode 100644 lib/harbor2_client/models/webhook_job.rb create mode 100644 lib/harbor2_client/models/webhook_last_trigger.rb create mode 100644 lib/harbor2_client/models/webhook_policy.rb create mode 100644 lib/harbor2_client/models/webhook_target_object.rb create mode 100644 spec/api/configure_api_spec.rb create mode 100644 spec/api/gc_api_spec.rb create mode 100644 spec/api/health_api_spec.rb create mode 100644 spec/api/immutable_api_spec.rb create mode 100644 spec/api/label_api_spec.rb create mode 100644 spec/api/ldap_api_spec.rb create mode 100644 spec/api/member_api_spec.rb create mode 100644 spec/api/oidc_api_spec.rb create mode 100644 spec/api/ping_api_spec.rb create mode 100644 spec/api/project_metadata_api_spec.rb create mode 100644 spec/api/quota_api_spec.rb create mode 100644 spec/api/registry_api_spec.rb create mode 100644 spec/api/replication_api_spec.rb create mode 100644 spec/api/retention_api_spec.rb create mode 100644 spec/api/robot_api_spec.rb create mode 100644 spec/api/robotv1_api_spec.rb create mode 100644 spec/api/scan_all_api_spec.rb create mode 100644 spec/api/scanner_api_spec.rb create mode 100644 spec/api/search_api_spec.rb create mode 100644 spec/api/statistic_api_spec.rb create mode 100644 spec/api/system_cve_allowlist_api_spec.rb create mode 100644 spec/api/systeminfo_api_spec.rb create mode 100644 spec/api/user_api_spec.rb create mode 100644 spec/api/usergroup_api_spec.rb create mode 100644 spec/api/webhook_api_spec.rb create mode 100644 spec/api/webhookjob_api_spec.rb create mode 100644 spec/models/access_spec.rb create mode 100644 spec/models/authproxy_setting_spec.rb create mode 100644 spec/models/body_1_spec.rb create mode 100644 spec/models/body_spec.rb create mode 100644 spec/models/bool_config_item_spec.rb create mode 100644 spec/models/chart_metadata_spec.rb create mode 100644 spec/models/chart_version_spec.rb create mode 100644 spec/models/component_health_status_spec.rb create mode 100644 spec/models/configurations_response_scan_all_policy_parameter_spec.rb create mode 100644 spec/models/configurations_response_scan_all_policy_spec.rb create mode 100644 spec/models/configurations_response_spec.rb create mode 100644 spec/models/configurations_spec.rb create mode 100644 spec/models/endpoint_spec.rb create mode 100644 spec/models/event_type_spec.rb create mode 100644 spec/models/filter_style_spec.rb create mode 100644 spec/models/gc_history_spec.rb create mode 100644 spec/models/general_info_spec.rb create mode 100644 spec/models/immutable_rule_spec.rb create mode 100644 spec/models/immutable_selector_spec.rb create mode 100644 spec/models/integer_config_item_spec.rb create mode 100644 spec/models/internal_configurations_response_spec.rb create mode 100644 spec/models/is_default_spec.rb create mode 100644 spec/models/ldap_conf_spec.rb create mode 100644 spec/models/ldap_failed_import_user_spec.rb create mode 100644 spec/models/ldap_import_users_spec.rb create mode 100644 spec/models/ldap_ping_result_spec.rb create mode 100644 spec/models/ldap_user_spec.rb create mode 100644 spec/models/notify_type_spec.rb create mode 100644 spec/models/oidc_cli_secret_req_spec.rb create mode 100644 spec/models/oidc_user_info_spec.rb create mode 100644 spec/models/overall_health_status_spec.rb create mode 100644 spec/models/password_req_spec.rb create mode 100644 spec/models/permission_spec.rb create mode 100644 spec/models/project_member_entity_spec.rb create mode 100644 spec/models/project_member_spec.rb create mode 100644 spec/models/project_scanner_spec.rb create mode 100644 spec/models/quota_ref_object_spec.rb create mode 100644 spec/models/quota_spec.rb create mode 100644 spec/models/quota_update_req_spec.rb create mode 100644 spec/models/registry_endpoint_spec.rb create mode 100644 spec/models/registry_info_spec.rb create mode 100644 spec/models/registry_ping_spec.rb create mode 100644 spec/models/registry_provider_credential_pattern_spec.rb create mode 100644 spec/models/registry_provider_endpoint_pattern_spec.rb create mode 100644 spec/models/registry_provider_info_spec.rb create mode 100644 spec/models/registry_update_spec.rb create mode 100644 spec/models/replication_execution_spec.rb create mode 100644 spec/models/replication_filter_spec.rb create mode 100644 spec/models/replication_policy_spec.rb create mode 100644 spec/models/replication_task_spec.rb create mode 100644 spec/models/replication_trigger_settings_spec.rb create mode 100644 spec/models/replication_trigger_spec.rb create mode 100644 spec/models/retention_execution_spec.rb create mode 100644 spec/models/retention_execution_task_spec.rb create mode 100644 spec/models/retention_metadata_spec.rb create mode 100644 spec/models/retention_policy_scope_spec.rb create mode 100644 spec/models/retention_policy_spec.rb create mode 100644 spec/models/retention_rule_metadata_spec.rb create mode 100644 spec/models/retention_rule_param_metadata_spec.rb create mode 100644 spec/models/retention_rule_spec.rb create mode 100644 spec/models/retention_rule_trigger_spec.rb create mode 100644 spec/models/retention_selector_metadata_spec.rb create mode 100644 spec/models/retention_selector_spec.rb create mode 100644 spec/models/robot_create_spec.rb create mode 100644 spec/models/robot_create_v1_spec.rb create mode 100644 spec/models/robot_created_spec.rb create mode 100644 spec/models/robot_permission_spec.rb create mode 100644 spec/models/robot_sec_spec.rb create mode 100644 spec/models/robot_spec.rb create mode 100644 spec/models/role_request_spec.rb create mode 100644 spec/models/scanner_adapter_metadata_spec.rb create mode 100644 spec/models/scanner_capability_spec.rb create mode 100644 spec/models/scanner_registration_req_spec.rb create mode 100644 spec/models/scanner_registration_settings_spec.rb create mode 100644 spec/models/scanner_registration_spec.rb create mode 100644 spec/models/scanner_spec.rb create mode 100644 spec/models/schedule_obj_spec.rb create mode 100644 spec/models/schedule_spec.rb create mode 100644 spec/models/search_repository_spec.rb create mode 100644 spec/models/search_result_spec.rb create mode 100644 spec/models/search_spec.rb create mode 100644 spec/models/start_replication_execution_spec.rb create mode 100644 spec/models/statistic_spec.rb create mode 100644 spec/models/stats_spec.rb create mode 100644 spec/models/storage_spec.rb create mode 100644 spec/models/string_config_item_spec.rb create mode 100644 spec/models/supported_webhook_event_types_spec.rb create mode 100644 spec/models/system_info_spec.rb create mode 100644 spec/models/user_creation_req_spec.rb create mode 100644 spec/models/user_entity_spec.rb create mode 100644 spec/models/user_group_spec.rb create mode 100644 spec/models/user_profile_spec.rb create mode 100644 spec/models/user_resp_spec.rb create mode 100644 spec/models/user_search_resp_item_spec.rb create mode 100644 spec/models/user_search_spec.rb create mode 100644 spec/models/user_sys_admin_flag_spec.rb create mode 100644 spec/models/webhook_job_spec.rb create mode 100644 spec/models/webhook_last_trigger_spec.rb create mode 100644 spec/models/webhook_policy_spec.rb create mode 100644 spec/models/webhook_target_object_spec.rb diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION index b29b920..7652d37 100644 --- a/.swagger-codegen/VERSION +++ b/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.17 \ No newline at end of file +2.4.22 \ No newline at end of file diff --git a/README.md b/README.md index 514366f..e905f24 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,17 @@ # harbor2_client -Harbor2Client - the Ruby gem for the [Harbor 2 API](https://github.com/goharbor/harbor/blob/master/api/v2.0/swagger.yaml). +Harbor2Client - the Ruby gem for the Harbor API -These APIs provide services for manipulating Harbor projects. +These APIs provide services for manipulating Harbor project. This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 2.0 -- Package version: 0.2.0 +- Package version: 2.3.3.0 - Build package: io.swagger.codegen.languages.RubyClientCodegen ## Installation -### Install from RubyGems - -```shell -gem install harbor2_client -``` - ### Build a gem To build the Ruby code into a gem: @@ -29,21 +23,21 @@ gem build harbor2_client.gemspec Then either install the gem locally: ```shell -gem install ./harbor2_client-0.2.0.gem +gem install ./harbor2_client-2.3.3.0.gem ``` -(for development, run `gem install --dev ./harbor2_client-0.2.0.gem` to install the development dependencies) +(for development, run `gem install --dev ./harbor2_client-2.3.3.0.gem` to install the development dependencies) or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). Finally add this to the Gemfile: - gem 'harbor2_client', '~> 0.2.0' + gem 'harbor2_client', '~> 2.3.3.0' ### Install from Git -If the Ruby gem is hosted at a git repository: https://github.com/YOUR_GIT_USERNAME/YOUR_GIT_REPO, then add the following in the Gemfile: +If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - gem 'harbor2_client', :git => 'https://github.com/YOUR_GIT_USERNAME/YOUR_GIT_REPO.git' + gem 'harbor2_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' ### Include the Ruby code directly @@ -103,11 +97,42 @@ Class | Method | HTTP request | Description *Harbor2Client::ArtifactApi* | [**delete_tag**](docs/ArtifactApi.md#delete_tag) | **DELETE** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags/{tag_name} | Delete tag *Harbor2Client::ArtifactApi* | [**get_addition**](docs/ArtifactApi.md#get_addition) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/{addition} | Get the addition of the specific artifact *Harbor2Client::ArtifactApi* | [**get_artifact**](docs/ArtifactApi.md#get_artifact) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference} | Get the specific artifact +*Harbor2Client::ArtifactApi* | [**get_vulnerabilities_addition**](docs/ArtifactApi.md#get_vulnerabilities_addition) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/vulnerabilities | Get the vulnerabilities addition of the specific artifact *Harbor2Client::ArtifactApi* | [**list_artifacts**](docs/ArtifactApi.md#list_artifacts) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts | List artifacts *Harbor2Client::ArtifactApi* | [**list_tags**](docs/ArtifactApi.md#list_tags) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags | List tags *Harbor2Client::ArtifactApi* | [**remove_label**](docs/ArtifactApi.md#remove_label) | **DELETE** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels/{label_id} | Remove label from artifact *Harbor2Client::AuditlogApi* | [**list_audit_logs**](docs/AuditlogApi.md#list_audit_logs) | **GET** /audit-logs | Get recent logs of the projects which the user is a member of +*Harbor2Client::ConfigureApi* | [**get_configurations**](docs/ConfigureApi.md#get_configurations) | **GET** /configurations | Get system configurations. +*Harbor2Client::ConfigureApi* | [**get_internalconfig**](docs/ConfigureApi.md#get_internalconfig) | **GET** /internalconfig | Get internal configurations. +*Harbor2Client::ConfigureApi* | [**update_configurations**](docs/ConfigureApi.md#update_configurations) | **PUT** /configurations | Modify system configurations. +*Harbor2Client::GcApi* | [**create_gc_schedule**](docs/GcApi.md#create_gc_schedule) | **POST** /system/gc/schedule | Create a gc schedule. +*Harbor2Client::GcApi* | [**get_gc**](docs/GcApi.md#get_gc) | **GET** /system/gc/{gc_id} | Get gc status. +*Harbor2Client::GcApi* | [**get_gc_history**](docs/GcApi.md#get_gc_history) | **GET** /system/gc | Get gc results. +*Harbor2Client::GcApi* | [**get_gc_log**](docs/GcApi.md#get_gc_log) | **GET** /system/gc/{gc_id}/log | Get gc job log. +*Harbor2Client::GcApi* | [**get_gc_schedule**](docs/GcApi.md#get_gc_schedule) | **GET** /system/gc/schedule | Get gc's schedule. +*Harbor2Client::GcApi* | [**update_gc_schedule**](docs/GcApi.md#update_gc_schedule) | **PUT** /system/gc/schedule | Update gc's schedule. +*Harbor2Client::HealthApi* | [**get_health**](docs/HealthApi.md#get_health) | **GET** /health | Check the status of Harbor components *Harbor2Client::IconApi* | [**get_icon**](docs/IconApi.md#get_icon) | **GET** /icons/{digest} | Get artifact icon +*Harbor2Client::ImmutableApi* | [**create_immu_rule**](docs/ImmutableApi.md#create_immu_rule) | **POST** /projects/{project_name_or_id}/immutabletagrules | Add an immutable tag rule to current project +*Harbor2Client::ImmutableApi* | [**delete_immu_rule**](docs/ImmutableApi.md#delete_immu_rule) | **DELETE** /projects/{project_name_or_id}/immutabletagrules/{immutable_rule_id} | Delete the immutable tag rule. +*Harbor2Client::ImmutableApi* | [**list_immu_rules**](docs/ImmutableApi.md#list_immu_rules) | **GET** /projects/{project_name_or_id}/immutabletagrules | List all immutable tag rules of current project +*Harbor2Client::ImmutableApi* | [**update_immu_rule**](docs/ImmutableApi.md#update_immu_rule) | **PUT** /projects/{project_name_or_id}/immutabletagrules/{immutable_rule_id} | Update the immutable tag rule or enable or disable the rule +*Harbor2Client::LabelApi* | [**create_label**](docs/LabelApi.md#create_label) | **POST** /labels | Post creates a label +*Harbor2Client::LabelApi* | [**delete_label**](docs/LabelApi.md#delete_label) | **DELETE** /labels/{label_id} | Delete the label specified by ID. +*Harbor2Client::LabelApi* | [**get_label_by_id**](docs/LabelApi.md#get_label_by_id) | **GET** /labels/{label_id} | Get the label specified by ID. +*Harbor2Client::LabelApi* | [**list_labels**](docs/LabelApi.md#list_labels) | **GET** /labels | List labels according to the query strings. +*Harbor2Client::LabelApi* | [**update_label**](docs/LabelApi.md#update_label) | **PUT** /labels/{label_id} | Update the label properties. +*Harbor2Client::LdapApi* | [**import_ldap_user**](docs/LdapApi.md#import_ldap_user) | **POST** /ldap/users/import | Import selected available ldap users. +*Harbor2Client::LdapApi* | [**ping_ldap**](docs/LdapApi.md#ping_ldap) | **POST** /ldap/ping | Ping available ldap service. +*Harbor2Client::LdapApi* | [**search_ldap_group**](docs/LdapApi.md#search_ldap_group) | **GET** /ldap/groups/search | Search available ldap groups. +*Harbor2Client::LdapApi* | [**search_ldap_user**](docs/LdapApi.md#search_ldap_user) | **GET** /ldap/users/search | Search available ldap users. +*Harbor2Client::MemberApi* | [**create_project_member**](docs/MemberApi.md#create_project_member) | **POST** /projects/{project_name_or_id}/members | Create project member +*Harbor2Client::MemberApi* | [**delete_project_member**](docs/MemberApi.md#delete_project_member) | **DELETE** /projects/{project_name_or_id}/members/{mid} | Delete project member +*Harbor2Client::MemberApi* | [**get_project_member**](docs/MemberApi.md#get_project_member) | **GET** /projects/{project_name_or_id}/members/{mid} | Get the project member information +*Harbor2Client::MemberApi* | [**list_project_members**](docs/MemberApi.md#list_project_members) | **GET** /projects/{project_name_or_id}/members | Get all project member information +*Harbor2Client::MemberApi* | [**update_project_member**](docs/MemberApi.md#update_project_member) | **PUT** /projects/{project_name_or_id}/members/{mid} | Update project member +*Harbor2Client::OidcApi* | [**ping_oidc**](docs/OidcApi.md#ping_oidc) | **POST** /system/oidc/ping | Test the OIDC endpoint. +*Harbor2Client::PingApi* | [**get_ping**](docs/PingApi.md#get_ping) | **GET** /ping | Ping Harbor to check if it's alive. *Harbor2Client::PreheatApi* | [**create_instance**](docs/PreheatApi.md#create_instance) | **POST** /p2p/preheat/instances | Create p2p provider instances *Harbor2Client::PreheatApi* | [**create_policy**](docs/PreheatApi.md#create_policy) | **POST** /projects/{project_name}/preheat/policies | Create a preheat policy under a project *Harbor2Client::PreheatApi* | [**delete_instance**](docs/PreheatApi.md#delete_instance) | **DELETE** /p2p/preheat/instances/{preheat_instance_name} | Delete the specified P2P provider instance @@ -128,59 +153,256 @@ Class | Method | HTTP request | Description *Harbor2Client::PreheatApi* | [**update_instance**](docs/PreheatApi.md#update_instance) | **PUT** /p2p/preheat/instances/{preheat_instance_name} | Update the specified P2P provider instance *Harbor2Client::PreheatApi* | [**update_policy**](docs/PreheatApi.md#update_policy) | **PUT** /projects/{project_name}/preheat/policies/{preheat_policy_name} | Update preheat policy *Harbor2Client::ProjectApi* | [**create_project**](docs/ProjectApi.md#create_project) | **POST** /projects | Create a new project. -*Harbor2Client::ProjectApi* | [**delete_project**](docs/ProjectApi.md#delete_project) | **DELETE** /projects/{project_id} | Delete project by projectID +*Harbor2Client::ProjectApi* | [**delete_project**](docs/ProjectApi.md#delete_project) | **DELETE** /projects/{project_name_or_id} | Delete project by projectID *Harbor2Client::ProjectApi* | [**get_logs**](docs/ProjectApi.md#get_logs) | **GET** /projects/{project_name}/logs | Get recent logs of the projects -*Harbor2Client::ProjectApi* | [**get_project**](docs/ProjectApi.md#get_project) | **GET** /projects/{project_id} | Return specific project detail information -*Harbor2Client::ProjectApi* | [**get_project_deletable**](docs/ProjectApi.md#get_project_deletable) | **GET** /projects/{project_id}/_deletable | Get the deletable status of the project -*Harbor2Client::ProjectApi* | [**get_project_summary**](docs/ProjectApi.md#get_project_summary) | **GET** /projects/{project_id}/summary | Get summary of the project. +*Harbor2Client::ProjectApi* | [**get_project**](docs/ProjectApi.md#get_project) | **GET** /projects/{project_name_or_id} | Return specific project detail information +*Harbor2Client::ProjectApi* | [**get_project_deletable**](docs/ProjectApi.md#get_project_deletable) | **GET** /projects/{project_name_or_id}/_deletable | Get the deletable status of the project +*Harbor2Client::ProjectApi* | [**get_project_summary**](docs/ProjectApi.md#get_project_summary) | **GET** /projects/{project_name_or_id}/summary | Get summary of the project. +*Harbor2Client::ProjectApi* | [**get_scanner_of_project**](docs/ProjectApi.md#get_scanner_of_project) | **GET** /projects/{project_name_or_id}/scanner | Get project level scanner *Harbor2Client::ProjectApi* | [**head_project**](docs/ProjectApi.md#head_project) | **HEAD** /projects | Check if the project name user provided already exists. *Harbor2Client::ProjectApi* | [**list_projects**](docs/ProjectApi.md#list_projects) | **GET** /projects | List projects -*Harbor2Client::ProjectApi* | [**update_project**](docs/ProjectApi.md#update_project) | **PUT** /projects/{project_id} | Update properties for a selected project. +*Harbor2Client::ProjectApi* | [**list_scanner_candidates_of_project**](docs/ProjectApi.md#list_scanner_candidates_of_project) | **GET** /projects/{project_name_or_id}/scanner/candidates | Get scanner registration candidates for configurating project level scanner +*Harbor2Client::ProjectApi* | [**set_scanner_of_project**](docs/ProjectApi.md#set_scanner_of_project) | **PUT** /projects/{project_name_or_id}/scanner | Configure scanner for the specified project +*Harbor2Client::ProjectApi* | [**update_project**](docs/ProjectApi.md#update_project) | **PUT** /projects/{project_name_or_id} | Update properties for a selected project. +*Harbor2Client::ProjectMetadataApi* | [**add_project_metadatas**](docs/ProjectMetadataApi.md#add_project_metadatas) | **POST** /projects/{project_name_or_id}/metadatas/ | Add metadata for the specific project +*Harbor2Client::ProjectMetadataApi* | [**delete_project_metadata**](docs/ProjectMetadataApi.md#delete_project_metadata) | **DELETE** /projects/{project_name_or_id}/metadatas/{meta_name} | Delete the specific metadata for the specific project +*Harbor2Client::ProjectMetadataApi* | [**get_project_metadata**](docs/ProjectMetadataApi.md#get_project_metadata) | **GET** /projects/{project_name_or_id}/metadatas/{meta_name} | Get the specific metadata of the specific project +*Harbor2Client::ProjectMetadataApi* | [**list_project_metadatas**](docs/ProjectMetadataApi.md#list_project_metadatas) | **GET** /projects/{project_name_or_id}/metadatas/ | Get the metadata of the specific project +*Harbor2Client::ProjectMetadataApi* | [**update_project_metadata**](docs/ProjectMetadataApi.md#update_project_metadata) | **PUT** /projects/{project_name_or_id}/metadatas/{meta_name} | Update the specific metadata for the specific project +*Harbor2Client::QuotaApi* | [**get_quota**](docs/QuotaApi.md#get_quota) | **GET** /quotas/{id} | Get the specified quota +*Harbor2Client::QuotaApi* | [**list_quotas**](docs/QuotaApi.md#list_quotas) | **GET** /quotas | List quotas +*Harbor2Client::QuotaApi* | [**update_quota**](docs/QuotaApi.md#update_quota) | **PUT** /quotas/{id} | Update the specified quota +*Harbor2Client::RegistryApi* | [**create_registry**](docs/RegistryApi.md#create_registry) | **POST** /registries | Create a registry +*Harbor2Client::RegistryApi* | [**delete_registry**](docs/RegistryApi.md#delete_registry) | **DELETE** /registries/{id} | Delete the specific registry +*Harbor2Client::RegistryApi* | [**get_registry**](docs/RegistryApi.md#get_registry) | **GET** /registries/{id} | Get the specific registry +*Harbor2Client::RegistryApi* | [**get_registry_info**](docs/RegistryApi.md#get_registry_info) | **GET** /registries/{id}/info | Get the registry info +*Harbor2Client::RegistryApi* | [**list_registries**](docs/RegistryApi.md#list_registries) | **GET** /registries | List the registries +*Harbor2Client::RegistryApi* | [**list_registry_provider_infos**](docs/RegistryApi.md#list_registry_provider_infos) | **GET** /replication/adapterinfos | List all registered registry provider information +*Harbor2Client::RegistryApi* | [**list_registry_provider_types**](docs/RegistryApi.md#list_registry_provider_types) | **GET** /replication/adapters | List registry adapters +*Harbor2Client::RegistryApi* | [**ping_registry**](docs/RegistryApi.md#ping_registry) | **POST** /registries/ping | Check status of a registry +*Harbor2Client::RegistryApi* | [**update_registry**](docs/RegistryApi.md#update_registry) | **PUT** /registries/{id} | Update the registry +*Harbor2Client::ReplicationApi* | [**create_replication_policy**](docs/ReplicationApi.md#create_replication_policy) | **POST** /replication/policies | Create a replication policy +*Harbor2Client::ReplicationApi* | [**delete_replication_policy**](docs/ReplicationApi.md#delete_replication_policy) | **DELETE** /replication/policies/{id} | Delete the specific replication policy +*Harbor2Client::ReplicationApi* | [**get_replication_execution**](docs/ReplicationApi.md#get_replication_execution) | **GET** /replication/executions/{id} | Get the specific replication execution +*Harbor2Client::ReplicationApi* | [**get_replication_log**](docs/ReplicationApi.md#get_replication_log) | **GET** /replication/executions/{id}/tasks/{task_id}/log | Get the log of the specific replication task +*Harbor2Client::ReplicationApi* | [**get_replication_policy**](docs/ReplicationApi.md#get_replication_policy) | **GET** /replication/policies/{id} | Get the specific replication policy +*Harbor2Client::ReplicationApi* | [**list_replication_executions**](docs/ReplicationApi.md#list_replication_executions) | **GET** /replication/executions | List replication executions +*Harbor2Client::ReplicationApi* | [**list_replication_policies**](docs/ReplicationApi.md#list_replication_policies) | **GET** /replication/policies | List replication policies +*Harbor2Client::ReplicationApi* | [**list_replication_tasks**](docs/ReplicationApi.md#list_replication_tasks) | **GET** /replication/executions/{id}/tasks | List replication tasks for a specific execution +*Harbor2Client::ReplicationApi* | [**start_replication**](docs/ReplicationApi.md#start_replication) | **POST** /replication/executions | Start one replication execution +*Harbor2Client::ReplicationApi* | [**stop_replication**](docs/ReplicationApi.md#stop_replication) | **PUT** /replication/executions/{id} | Stop the specific replication execution +*Harbor2Client::ReplicationApi* | [**update_replication_policy**](docs/ReplicationApi.md#update_replication_policy) | **PUT** /replication/policies/{id} | Update the replication policy *Harbor2Client::RepositoryApi* | [**delete_repository**](docs/RepositoryApi.md#delete_repository) | **DELETE** /projects/{project_name}/repositories/{repository_name} | Delete repository *Harbor2Client::RepositoryApi* | [**get_repository**](docs/RepositoryApi.md#get_repository) | **GET** /projects/{project_name}/repositories/{repository_name} | Get repository +*Harbor2Client::RepositoryApi* | [**list_all_repositories**](docs/RepositoryApi.md#list_all_repositories) | **GET** /repositories | List all authorized repositories *Harbor2Client::RepositoryApi* | [**list_repositories**](docs/RepositoryApi.md#list_repositories) | **GET** /projects/{project_name}/repositories | List repositories *Harbor2Client::RepositoryApi* | [**update_repository**](docs/RepositoryApi.md#update_repository) | **PUT** /projects/{project_name}/repositories/{repository_name} | Update repository +*Harbor2Client::RetentionApi* | [**create_retention**](docs/RetentionApi.md#create_retention) | **POST** /retentions | Create Retention Policy +*Harbor2Client::RetentionApi* | [**delete_retention**](docs/RetentionApi.md#delete_retention) | **DELETE** /retentions/{id} | Delete Retention Policy +*Harbor2Client::RetentionApi* | [**get_rentenition_metadata**](docs/RetentionApi.md#get_rentenition_metadata) | **GET** /retentions/metadatas | Get Retention Metadatas +*Harbor2Client::RetentionApi* | [**get_retention**](docs/RetentionApi.md#get_retention) | **GET** /retentions/{id} | Get Retention Policy +*Harbor2Client::RetentionApi* | [**get_retention_task_log**](docs/RetentionApi.md#get_retention_task_log) | **GET** /retentions/{id}/executions/{eid}/tasks/{tid} | Get Retention job task log +*Harbor2Client::RetentionApi* | [**list_retention_executions**](docs/RetentionApi.md#list_retention_executions) | **GET** /retentions/{id}/executions | Get Retention executions +*Harbor2Client::RetentionApi* | [**list_retention_tasks**](docs/RetentionApi.md#list_retention_tasks) | **GET** /retentions/{id}/executions/{eid}/tasks | Get Retention tasks +*Harbor2Client::RetentionApi* | [**operate_retention_execution**](docs/RetentionApi.md#operate_retention_execution) | **PATCH** /retentions/{id}/executions/{eid} | Stop a Retention execution +*Harbor2Client::RetentionApi* | [**trigger_retention_execution**](docs/RetentionApi.md#trigger_retention_execution) | **POST** /retentions/{id}/executions | Trigger a Retention Execution +*Harbor2Client::RetentionApi* | [**update_retention**](docs/RetentionApi.md#update_retention) | **PUT** /retentions/{id} | Update Retention Policy +*Harbor2Client::RobotApi* | [**create_robot**](docs/RobotApi.md#create_robot) | **POST** /robots | Create a robot account +*Harbor2Client::RobotApi* | [**delete_robot**](docs/RobotApi.md#delete_robot) | **DELETE** /robots/{robot_id} | Delete a robot account +*Harbor2Client::RobotApi* | [**get_robot_by_id**](docs/RobotApi.md#get_robot_by_id) | **GET** /robots/{robot_id} | Get a robot account +*Harbor2Client::RobotApi* | [**list_robot**](docs/RobotApi.md#list_robot) | **GET** /robots | Get robot account +*Harbor2Client::RobotApi* | [**refresh_sec**](docs/RobotApi.md#refresh_sec) | **PATCH** /robots/{robot_id} | Refresh the robot secret +*Harbor2Client::RobotApi* | [**update_robot**](docs/RobotApi.md#update_robot) | **PUT** /robots/{robot_id} | Update a robot account +*Harbor2Client::Robotv1Api* | [**create_robot_v1**](docs/Robotv1Api.md#create_robot_v1) | **POST** /projects/{project_name_or_id}/robots | Create a robot account +*Harbor2Client::Robotv1Api* | [**delete_robot_v1**](docs/Robotv1Api.md#delete_robot_v1) | **DELETE** /projects/{project_name_or_id}/robots/{robot_id} | Delete a robot account +*Harbor2Client::Robotv1Api* | [**get_robot_by_idv1**](docs/Robotv1Api.md#get_robot_by_idv1) | **GET** /projects/{project_name_or_id}/robots/{robot_id} | Get a robot account +*Harbor2Client::Robotv1Api* | [**list_robot_v1**](docs/Robotv1Api.md#list_robot_v1) | **GET** /projects/{project_name_or_id}/robots | Get all robot accounts of specified project +*Harbor2Client::Robotv1Api* | [**update_robot_v1**](docs/Robotv1Api.md#update_robot_v1) | **PUT** /projects/{project_name_or_id}/robots/{robot_id} | Update status of robot account. *Harbor2Client::ScanApi* | [**get_report_log**](docs/ScanApi.md#get_report_log) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/{report_id}/log | Get the log of the scan report *Harbor2Client::ScanApi* | [**scan_artifact**](docs/ScanApi.md#scan_artifact) | **POST** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan | Scan the artifact +*Harbor2Client::ScanAllApi* | [**create_scan_all_schedule**](docs/ScanAllApi.md#create_scan_all_schedule) | **POST** /system/scanAll/schedule | Create a schedule or a manual trigger for the scan all job. +*Harbor2Client::ScanAllApi* | [**get_latest_scan_all_metrics**](docs/ScanAllApi.md#get_latest_scan_all_metrics) | **GET** /scans/all/metrics | Get the metrics of the latest scan all process +*Harbor2Client::ScanAllApi* | [**get_latest_scheduled_scan_all_metrics**](docs/ScanAllApi.md#get_latest_scheduled_scan_all_metrics) | **GET** /scans/schedule/metrics | Get the metrics of the latest scheduled scan all process +*Harbor2Client::ScanAllApi* | [**get_scan_all_schedule**](docs/ScanAllApi.md#get_scan_all_schedule) | **GET** /system/scanAll/schedule | Get scan all's schedule. +*Harbor2Client::ScanAllApi* | [**update_scan_all_schedule**](docs/ScanAllApi.md#update_scan_all_schedule) | **PUT** /system/scanAll/schedule | Update scan all's schedule. +*Harbor2Client::ScannerApi* | [**create_scanner**](docs/ScannerApi.md#create_scanner) | **POST** /scanners | Create a scanner registration +*Harbor2Client::ScannerApi* | [**delete_scanner**](docs/ScannerApi.md#delete_scanner) | **DELETE** /scanners/{registration_id} | Delete a scanner registration +*Harbor2Client::ScannerApi* | [**get_scanner**](docs/ScannerApi.md#get_scanner) | **GET** /scanners/{registration_id} | Get a scanner registration details +*Harbor2Client::ScannerApi* | [**get_scanner_metadata**](docs/ScannerApi.md#get_scanner_metadata) | **GET** /scanners/{registration_id}/metadata | Get the metadata of the specified scanner registration +*Harbor2Client::ScannerApi* | [**list_scanners**](docs/ScannerApi.md#list_scanners) | **GET** /scanners | List scanner registrations +*Harbor2Client::ScannerApi* | [**ping_scanner**](docs/ScannerApi.md#ping_scanner) | **POST** /scanners/ping | Tests scanner registration settings +*Harbor2Client::ScannerApi* | [**set_scanner_as_default**](docs/ScannerApi.md#set_scanner_as_default) | **PATCH** /scanners/{registration_id} | Set system default scanner registration +*Harbor2Client::ScannerApi* | [**update_scanner**](docs/ScannerApi.md#update_scanner) | **PUT** /scanners/{registration_id} | Update a scanner registration +*Harbor2Client::SearchApi* | [**search**](docs/SearchApi.md#search) | **GET** /search | Search for projects, repositories and helm charts +*Harbor2Client::StatisticApi* | [**get_statistic**](docs/StatisticApi.md#get_statistic) | **GET** /statistics | Get the statistic information about the projects and repositories +*Harbor2Client::SystemCVEAllowlistApi* | [**get_system_cve_allowlist**](docs/SystemCVEAllowlistApi.md#get_system_cve_allowlist) | **GET** /system/CVEAllowlist | Get the system level allowlist of CVE. +*Harbor2Client::SystemCVEAllowlistApi* | [**put_system_cve_allowlist**](docs/SystemCVEAllowlistApi.md#put_system_cve_allowlist) | **PUT** /system/CVEAllowlist | Update the system level allowlist of CVE. +*Harbor2Client::SysteminfoApi* | [**get_cert**](docs/SysteminfoApi.md#get_cert) | **GET** /systeminfo/getcert | Get default root certificate. +*Harbor2Client::SysteminfoApi* | [**get_system_info**](docs/SysteminfoApi.md#get_system_info) | **GET** /systeminfo | Get general system info +*Harbor2Client::SysteminfoApi* | [**get_volumes**](docs/SysteminfoApi.md#get_volumes) | **GET** /systeminfo/volumes | Get system volume info (total/free size). +*Harbor2Client::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /users | Create a local user. +*Harbor2Client::UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /users/{user_id} | Mark a registered user as be removed. +*Harbor2Client::UserApi* | [**get_current_user_info**](docs/UserApi.md#get_current_user_info) | **GET** /users/current | Get current user info. +*Harbor2Client::UserApi* | [**get_current_user_permissions**](docs/UserApi.md#get_current_user_permissions) | **GET** /users/current/permissions | Get current user permissions. +*Harbor2Client::UserApi* | [**get_user**](docs/UserApi.md#get_user) | **GET** /users/{user_id} | Get a user's profile. +*Harbor2Client::UserApi* | [**list_users**](docs/UserApi.md#list_users) | **GET** /users | List users +*Harbor2Client::UserApi* | [**search_users**](docs/UserApi.md#search_users) | **GET** /users/search | Search users by username +*Harbor2Client::UserApi* | [**set_cli_secret**](docs/UserApi.md#set_cli_secret) | **PUT** /users/{user_id}/cli_secret | Set CLI secret for a user. +*Harbor2Client::UserApi* | [**set_user_sys_admin**](docs/UserApi.md#set_user_sys_admin) | **PUT** /users/{user_id}/sysadmin | Update a registered user to change to be an administrator of Harbor. +*Harbor2Client::UserApi* | [**update_user_password**](docs/UserApi.md#update_user_password) | **PUT** /users/{user_id}/password | Change the password on a user that already exists. +*Harbor2Client::UserApi* | [**update_user_profile**](docs/UserApi.md#update_user_profile) | **PUT** /users/{user_id} | Update user's profile. +*Harbor2Client::UsergroupApi* | [**create_user_group**](docs/UsergroupApi.md#create_user_group) | **POST** /usergroups | Create user group +*Harbor2Client::UsergroupApi* | [**delete_user_group**](docs/UsergroupApi.md#delete_user_group) | **DELETE** /usergroups/{group_id} | Delete user group +*Harbor2Client::UsergroupApi* | [**get_user_group**](docs/UsergroupApi.md#get_user_group) | **GET** /usergroups/{group_id} | Get user group information +*Harbor2Client::UsergroupApi* | [**list_user_groups**](docs/UsergroupApi.md#list_user_groups) | **GET** /usergroups | Get all user groups information +*Harbor2Client::UsergroupApi* | [**update_user_group**](docs/UsergroupApi.md#update_user_group) | **PUT** /usergroups/{group_id} | Update group information +*Harbor2Client::WebhookApi* | [**create_webhook_policy_of_project**](docs/WebhookApi.md#create_webhook_policy_of_project) | **POST** /projects/{project_name_or_id}/webhook/policies | Create project webhook policy. +*Harbor2Client::WebhookApi* | [**delete_webhook_policy_of_project**](docs/WebhookApi.md#delete_webhook_policy_of_project) | **DELETE** /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id} | Delete webhook policy of a project +*Harbor2Client::WebhookApi* | [**get_supported_event_types**](docs/WebhookApi.md#get_supported_event_types) | **GET** /projects/{project_name_or_id}/webhook/events | Get supported event types and notify types. +*Harbor2Client::WebhookApi* | [**get_webhook_policy_of_project**](docs/WebhookApi.md#get_webhook_policy_of_project) | **GET** /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id} | Get project webhook policy +*Harbor2Client::WebhookApi* | [**last_trigger**](docs/WebhookApi.md#last_trigger) | **GET** /projects/{project_name_or_id}/webhook/lasttrigger | Get project webhook policy last trigger info +*Harbor2Client::WebhookApi* | [**list_webhook_policies_of_project**](docs/WebhookApi.md#list_webhook_policies_of_project) | **GET** /projects/{project_name_or_id}/webhook/policies | List project webhook policies. +*Harbor2Client::WebhookApi* | [**update_webhook_policy_of_project**](docs/WebhookApi.md#update_webhook_policy_of_project) | **PUT** /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id} | Update webhook policy of a project. +*Harbor2Client::WebhookjobApi* | [**list_webhook_jobs**](docs/WebhookjobApi.md#list_webhook_jobs) | **GET** /projects/{project_name_or_id}/webhook/jobs | List project webhook jobs ## Documentation for Models + - [Harbor2Client::Access](docs/Access.md) - [Harbor2Client::AdditionLink](docs/AdditionLink.md) - [Harbor2Client::AdditionLinks](docs/AdditionLinks.md) - [Harbor2Client::Annotations](docs/Annotations.md) - [Harbor2Client::Artifact](docs/Artifact.md) - [Harbor2Client::AuditLog](docs/AuditLog.md) + - [Harbor2Client::AuthproxySetting](docs/AuthproxySetting.md) + - [Harbor2Client::Body](docs/Body.md) + - [Harbor2Client::Body1](docs/Body1.md) + - [Harbor2Client::BoolConfigItem](docs/BoolConfigItem.md) - [Harbor2Client::CVEAllowlist](docs/CVEAllowlist.md) - [Harbor2Client::CVEAllowlistItem](docs/CVEAllowlistItem.md) + - [Harbor2Client::ChartMetadata](docs/ChartMetadata.md) + - [Harbor2Client::ChartVersion](docs/ChartVersion.md) + - [Harbor2Client::ComponentHealthStatus](docs/ComponentHealthStatus.md) + - [Harbor2Client::Configurations](docs/Configurations.md) + - [Harbor2Client::ConfigurationsResponse](docs/ConfigurationsResponse.md) + - [Harbor2Client::ConfigurationsResponseScanAllPolicy](docs/ConfigurationsResponseScanAllPolicy.md) + - [Harbor2Client::ConfigurationsResponseScanAllPolicyParameter](docs/ConfigurationsResponseScanAllPolicyParameter.md) + - [Harbor2Client::Endpoint](docs/Endpoint.md) - [Harbor2Client::Error](docs/Error.md) - [Harbor2Client::Errors](docs/Errors.md) + - [Harbor2Client::EventType](docs/EventType.md) - [Harbor2Client::Execution](docs/Execution.md) - [Harbor2Client::ExtraAttrs](docs/ExtraAttrs.md) + - [Harbor2Client::FilterStyle](docs/FilterStyle.md) + - [Harbor2Client::GCHistory](docs/GCHistory.md) + - [Harbor2Client::GeneralInfo](docs/GeneralInfo.md) - [Harbor2Client::Icon](docs/Icon.md) + - [Harbor2Client::ImmutableRule](docs/ImmutableRule.md) + - [Harbor2Client::ImmutableSelector](docs/ImmutableSelector.md) - [Harbor2Client::Instance](docs/Instance.md) + - [Harbor2Client::IntegerConfigItem](docs/IntegerConfigItem.md) + - [Harbor2Client::InternalConfigurationsResponse](docs/InternalConfigurationsResponse.md) + - [Harbor2Client::IsDefault](docs/IsDefault.md) - [Harbor2Client::Label](docs/Label.md) + - [Harbor2Client::LdapConf](docs/LdapConf.md) + - [Harbor2Client::LdapFailedImportUser](docs/LdapFailedImportUser.md) + - [Harbor2Client::LdapImportUsers](docs/LdapImportUsers.md) + - [Harbor2Client::LdapPingResult](docs/LdapPingResult.md) + - [Harbor2Client::LdapUser](docs/LdapUser.md) - [Harbor2Client::Metadata](docs/Metadata.md) - [Harbor2Client::Metrics](docs/Metrics.md) - [Harbor2Client::NativeReportSummary](docs/NativeReportSummary.md) + - [Harbor2Client::NotifyType](docs/NotifyType.md) + - [Harbor2Client::OIDCCliSecretReq](docs/OIDCCliSecretReq.md) + - [Harbor2Client::OIDCUserInfo](docs/OIDCUserInfo.md) + - [Harbor2Client::OverallHealthStatus](docs/OverallHealthStatus.md) + - [Harbor2Client::PasswordReq](docs/PasswordReq.md) + - [Harbor2Client::Permission](docs/Permission.md) - [Harbor2Client::Platform](docs/Platform.md) - [Harbor2Client::PreheatPolicy](docs/PreheatPolicy.md) - [Harbor2Client::Project](docs/Project.md) - [Harbor2Client::ProjectDeletable](docs/ProjectDeletable.md) + - [Harbor2Client::ProjectMember](docs/ProjectMember.md) + - [Harbor2Client::ProjectMemberEntity](docs/ProjectMemberEntity.md) - [Harbor2Client::ProjectMetadata](docs/ProjectMetadata.md) - [Harbor2Client::ProjectReq](docs/ProjectReq.md) + - [Harbor2Client::ProjectScanner](docs/ProjectScanner.md) - [Harbor2Client::ProjectSummary](docs/ProjectSummary.md) - [Harbor2Client::ProjectSummaryQuota](docs/ProjectSummaryQuota.md) - [Harbor2Client::ProviderUnderProject](docs/ProviderUnderProject.md) + - [Harbor2Client::Quota](docs/Quota.md) + - [Harbor2Client::QuotaRefObject](docs/QuotaRefObject.md) + - [Harbor2Client::QuotaUpdateReq](docs/QuotaUpdateReq.md) - [Harbor2Client::Reference](docs/Reference.md) - [Harbor2Client::Registry](docs/Registry.md) - [Harbor2Client::RegistryCredential](docs/RegistryCredential.md) + - [Harbor2Client::RegistryEndpoint](docs/RegistryEndpoint.md) + - [Harbor2Client::RegistryInfo](docs/RegistryInfo.md) + - [Harbor2Client::RegistryPing](docs/RegistryPing.md) + - [Harbor2Client::RegistryProviderCredentialPattern](docs/RegistryProviderCredentialPattern.md) + - [Harbor2Client::RegistryProviderEndpointPattern](docs/RegistryProviderEndpointPattern.md) + - [Harbor2Client::RegistryProviderInfo](docs/RegistryProviderInfo.md) + - [Harbor2Client::RegistryUpdate](docs/RegistryUpdate.md) + - [Harbor2Client::ReplicationExecution](docs/ReplicationExecution.md) + - [Harbor2Client::ReplicationFilter](docs/ReplicationFilter.md) + - [Harbor2Client::ReplicationPolicy](docs/ReplicationPolicy.md) + - [Harbor2Client::ReplicationTask](docs/ReplicationTask.md) + - [Harbor2Client::ReplicationTrigger](docs/ReplicationTrigger.md) + - [Harbor2Client::ReplicationTriggerSettings](docs/ReplicationTriggerSettings.md) - [Harbor2Client::Repository](docs/Repository.md) - [Harbor2Client::ResourceList](docs/ResourceList.md) + - [Harbor2Client::RetentionExecution](docs/RetentionExecution.md) + - [Harbor2Client::RetentionExecutionTask](docs/RetentionExecutionTask.md) + - [Harbor2Client::RetentionMetadata](docs/RetentionMetadata.md) + - [Harbor2Client::RetentionPolicy](docs/RetentionPolicy.md) + - [Harbor2Client::RetentionPolicyScope](docs/RetentionPolicyScope.md) + - [Harbor2Client::RetentionRule](docs/RetentionRule.md) + - [Harbor2Client::RetentionRuleMetadata](docs/RetentionRuleMetadata.md) + - [Harbor2Client::RetentionRuleParamMetadata](docs/RetentionRuleParamMetadata.md) + - [Harbor2Client::RetentionRuleTrigger](docs/RetentionRuleTrigger.md) + - [Harbor2Client::RetentionSelector](docs/RetentionSelector.md) + - [Harbor2Client::RetentionSelectorMetadata](docs/RetentionSelectorMetadata.md) + - [Harbor2Client::Robot](docs/Robot.md) + - [Harbor2Client::RobotCreate](docs/RobotCreate.md) + - [Harbor2Client::RobotCreateV1](docs/RobotCreateV1.md) + - [Harbor2Client::RobotCreated](docs/RobotCreated.md) + - [Harbor2Client::RobotPermission](docs/RobotPermission.md) + - [Harbor2Client::RobotSec](docs/RobotSec.md) + - [Harbor2Client::RoleRequest](docs/RoleRequest.md) - [Harbor2Client::ScanOverview](docs/ScanOverview.md) + - [Harbor2Client::Scanner](docs/Scanner.md) + - [Harbor2Client::ScannerAdapterMetadata](docs/ScannerAdapterMetadata.md) + - [Harbor2Client::ScannerCapability](docs/ScannerCapability.md) + - [Harbor2Client::ScannerRegistration](docs/ScannerRegistration.md) + - [Harbor2Client::ScannerRegistrationReq](docs/ScannerRegistrationReq.md) + - [Harbor2Client::ScannerRegistrationSettings](docs/ScannerRegistrationSettings.md) + - [Harbor2Client::Schedule](docs/Schedule.md) + - [Harbor2Client::ScheduleObj](docs/ScheduleObj.md) + - [Harbor2Client::Search](docs/Search.md) + - [Harbor2Client::SearchRepository](docs/SearchRepository.md) + - [Harbor2Client::SearchResult](docs/SearchResult.md) + - [Harbor2Client::StartReplicationExecution](docs/StartReplicationExecution.md) + - [Harbor2Client::Statistic](docs/Statistic.md) + - [Harbor2Client::Stats](docs/Stats.md) + - [Harbor2Client::Storage](docs/Storage.md) + - [Harbor2Client::StringConfigItem](docs/StringConfigItem.md) + - [Harbor2Client::SupportedWebhookEventTypes](docs/SupportedWebhookEventTypes.md) + - [Harbor2Client::SystemInfo](docs/SystemInfo.md) - [Harbor2Client::Tag](docs/Tag.md) - [Harbor2Client::Task](docs/Task.md) + - [Harbor2Client::UserCreationReq](docs/UserCreationReq.md) + - [Harbor2Client::UserEntity](docs/UserEntity.md) + - [Harbor2Client::UserGroup](docs/UserGroup.md) + - [Harbor2Client::UserProfile](docs/UserProfile.md) + - [Harbor2Client::UserResp](docs/UserResp.md) + - [Harbor2Client::UserSearch](docs/UserSearch.md) + - [Harbor2Client::UserSearchRespItem](docs/UserSearchRespItem.md) + - [Harbor2Client::UserSysAdminFlag](docs/UserSysAdminFlag.md) - [Harbor2Client::VulnerabilitySummary](docs/VulnerabilitySummary.md) + - [Harbor2Client::WebhookJob](docs/WebhookJob.md) + - [Harbor2Client::WebhookLastTrigger](docs/WebhookLastTrigger.md) + - [Harbor2Client::WebhookPolicy](docs/WebhookPolicy.md) + - [Harbor2Client::WebhookTargetObject](docs/WebhookTargetObject.md) ## Documentation for Authorization diff --git a/docs/Access.md b/docs/Access.md new file mode 100644 index 0000000..b627e82 --- /dev/null +++ b/docs/Access.md @@ -0,0 +1,10 @@ +# Harbor2Client::Access + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource** | **String** | The resource of the access | [optional] +**action** | **String** | The action of the access | [optional] +**effect** | **String** | The effect of the access | [optional] + + diff --git a/docs/ArtifactApi.md b/docs/ArtifactApi.md index 9e41192..c975fb5 100644 --- a/docs/ArtifactApi.md +++ b/docs/ArtifactApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**delete_tag**](ArtifactApi.md#delete_tag) | **DELETE** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags/{tag_name} | Delete tag [**get_addition**](ArtifactApi.md#get_addition) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/{addition} | Get the addition of the specific artifact [**get_artifact**](ArtifactApi.md#get_artifact) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference} | Get the specific artifact +[**get_vulnerabilities_addition**](ArtifactApi.md#get_vulnerabilities_addition) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/vulnerabilities | Get the vulnerabilities addition of the specific artifact [**list_artifacts**](ArtifactApi.md#list_artifacts) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts | List artifacts [**list_tags**](ArtifactApi.md#list_tags) | **GET** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags | List tags [**remove_label**](ArtifactApi.md#remove_label) | **DELETE** /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels/{label_id} | Remove label from artifact @@ -431,6 +432,7 @@ opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request page: 1, # Integer | The page number page_size: 10, # Integer | The size of per page + x_accept_vulnerabilities: 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' # String | A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' and 'application/vnd.security.vulnerability.report; version=1.1' with_tag: true, # BOOLEAN | Specify whether the tags are inclued inside the returning artifacts with_label: false, # BOOLEAN | Specify whether the labels are inclued inside the returning artifacts with_scan_overview: false, # BOOLEAN | Specify whether the scan overview is inclued inside the returning artifacts @@ -457,6 +459,7 @@ Name | Type | Description | Notes **x_request_id** | **String**| An unique ID for the request | [optional] **page** | **Integer**| The page number | [optional] [default to 1] **page_size** | **Integer**| The size of per page | [optional] [default to 10] + **x_accept_vulnerabilities** | **String**| A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' and 'application/vnd.security.vulnerability.report; version=1.1' | [optional] [default to application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0] **with_tag** | **BOOLEAN**| Specify whether the tags are inclued inside the returning artifacts | [optional] [default to true] **with_label** | **BOOLEAN**| Specify whether the labels are inclued inside the returning artifacts | [optional] [default to false] **with_scan_overview** | **BOOLEAN**| Specify whether the scan overview is inclued inside the returning artifacts | [optional] [default to false] @@ -478,6 +481,71 @@ Name | Type | Description | Notes +# **get_vulnerabilities_addition** +> String get_vulnerabilities_addition(project_namerepository_name, reference, , opts) + +Get the vulnerabilities addition of the specific artifact + +Get the vulnerabilities addition of the artifact specified by the reference under the project and repository. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ArtifactApi.new + +project_name = 'project_name_example' # String | The name of the project + +repository_name = 'repository_name_example' # String | The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb + +reference = 'reference_example' # String | The reference of the artifact, can be digest or tag + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_accept_vulnerabilities: 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' # String | A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' and 'application/vnd.security.vulnerability.report; version=1.1' +} + +begin + #Get the vulnerabilities addition of the specific artifact + result = api_instance.get_vulnerabilities_addition(project_namerepository_name, reference, , opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ArtifactApi->get_vulnerabilities_addition: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name** | **String**| The name of the project | + **repository_name** | **String**| The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb | + **reference** | **String**| The reference of the artifact, can be digest or tag | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_accept_vulnerabilities** | **String**| A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' and 'application/vnd.security.vulnerability.report; version=1.1' | [optional] [default to application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0] + +### Return type + +**String** + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + # **list_artifacts** > Array<Artifact> list_artifacts(project_namerepository_name, , opts) @@ -504,9 +572,11 @@ repository_name = 'repository_name_example' # String | The name of the repositor opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request - q: 'q_example' # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" page: 1, # Integer | The page number page_size: 10, # Integer | The size of per page + x_accept_vulnerabilities: 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' # String | A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' and 'application/vnd.security.vulnerability.report; version=1.1' with_tag: true, # BOOLEAN | Specify whether the tags are included inside the returning artifacts with_label: false, # BOOLEAN | Specify whether the labels are included inside the returning artifacts with_scan_overview: false, # BOOLEAN | Specify whether the scan overview is included inside the returning artifacts @@ -531,8 +601,10 @@ Name | Type | Description | Notes **repository_name** | **String**| The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb | **x_request_id** | **String**| An unique ID for the request | [optional] **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] **page** | **Integer**| The page number | [optional] [default to 1] **page_size** | **Integer**| The size of per page | [optional] [default to 10] + **x_accept_vulnerabilities** | **String**| A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' and 'application/vnd.security.vulnerability.report; version=1.1' | [optional] [default to application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0] **with_tag** | **BOOLEAN**| Specify whether the tags are included inside the returning artifacts | [optional] [default to true] **with_label** | **BOOLEAN**| Specify whether the labels are included inside the returning artifacts | [optional] [default to false] **with_scan_overview** | **BOOLEAN**| Specify whether the scan overview is included inside the returning artifacts | [optional] [default to false] @@ -582,7 +654,8 @@ reference = 'reference_example' # String | The reference of the artifact, can be opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request - q: 'q_example' # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" page: 1, # Integer | The page number page_size: 10, # Integer | The size of per page with_signature: false, # BOOLEAN | Specify whether the signature is included inside the returning tags @@ -607,6 +680,7 @@ Name | Type | Description | Notes **reference** | **String**| The reference of the artifact, can be digest or tag | **x_request_id** | **String**| An unique ID for the request | [optional] **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] **page** | **Integer**| The page number | [optional] [default to 1] **page_size** | **Integer**| The size of per page | [optional] [default to 10] **with_signature** | **BOOLEAN**| Specify whether the signature is included inside the returning tags | [optional] [default to false] diff --git a/docs/AuditlogApi.md b/docs/AuditlogApi.md index c2d93bc..2fce899 100644 --- a/docs/AuditlogApi.md +++ b/docs/AuditlogApi.md @@ -29,7 +29,8 @@ api_instance = Harbor2Client::AuditlogApi.new opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request - q: 'q_example' # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" page: 1, # Integer | The page number page_size: 10, # Integer | The size of per page } @@ -49,6 +50,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **x_request_id** | **String**| An unique ID for the request | [optional] **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] **page** | **Integer**| The page number | [optional] [default to 1] **page_size** | **Integer**| The size of per page | [optional] [default to 10] diff --git a/docs/AuthproxySetting.md b/docs/AuthproxySetting.md new file mode 100644 index 0000000..ddb8d13 --- /dev/null +++ b/docs/AuthproxySetting.md @@ -0,0 +1,12 @@ +# Harbor2Client::AuthproxySetting + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**endpoint** | **String** | The fully qualified URI of login endpoint of authproxy, such as 'https://192.168.1.2:8443/login' | [optional] +**tokenreivew_endpoint** | **String** | The fully qualified URI of token review endpoint of authproxy, such as 'https://192.168.1.2:8443/tokenreview' | [optional] +**skip_search** | **BOOLEAN** | The flag to determine whether Harbor can skip search the user/group when adding him as a member. | [optional] +**verify_cert** | **BOOLEAN** | The flag to determine whether Harbor should verify the certificate when connecting to the auth proxy. | [optional] +**server_certificate** | **String** | The certificate to be pinned when connecting auth proxy. | [optional] + + diff --git a/docs/Body.md b/docs/Body.md new file mode 100644 index 0000000..90e7862 --- /dev/null +++ b/docs/Body.md @@ -0,0 +1,8 @@ +# Harbor2Client::Body + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dry_run** | **BOOLEAN** | | [optional] + + diff --git a/docs/Body1.md b/docs/Body1.md new file mode 100644 index 0000000..77f7719 --- /dev/null +++ b/docs/Body1.md @@ -0,0 +1,8 @@ +# Harbor2Client::Body1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | [optional] + + diff --git a/docs/BoolConfigItem.md b/docs/BoolConfigItem.md new file mode 100644 index 0000000..e3903db --- /dev/null +++ b/docs/BoolConfigItem.md @@ -0,0 +1,9 @@ +# Harbor2Client::BoolConfigItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **BOOLEAN** | The boolean value of current config item | [optional] +**editable** | **BOOLEAN** | The configure item can be updated or not | [optional] + + diff --git a/docs/ChartMetadata.md b/docs/ChartMetadata.md new file mode 100644 index 0000000..2d4d92d --- /dev/null +++ b/docs/ChartMetadata.md @@ -0,0 +1,18 @@ +# Harbor2Client::ChartMetadata + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The name of the chart | +**home** | **String** | The URL to the relevant project page | [optional] +**sources** | **Array<String>** | The URL to the source code of chart | [optional] +**version** | **String** | A SemVer 2 version of chart | +**description** | **String** | A one-sentence description of chart | [optional] +**keywords** | **Array<String>** | A list of string keywords | [optional] +**engine** | **String** | The name of template engine | +**icon** | **String** | The URL to an icon file | +**api_version** | **String** | The API version of this chart | +**app_version** | **String** | The version of the application enclosed in the chart | +**deprecated** | **BOOLEAN** | Whether or not this chart is deprecated | [optional] + + diff --git a/docs/ChartVersion.md b/docs/ChartVersion.md new file mode 100644 index 0000000..1ca46be --- /dev/null +++ b/docs/ChartVersion.md @@ -0,0 +1,23 @@ +# Harbor2Client::ChartVersion + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The name of the chart | +**home** | **String** | The URL to the relevant project page | [optional] +**sources** | **Array<String>** | The URL to the source code of chart | [optional] +**version** | **String** | A SemVer 2 version of chart | +**description** | **String** | A one-sentence description of chart | [optional] +**keywords** | **Array<String>** | A list of string keywords | [optional] +**engine** | **String** | The name of template engine | +**icon** | **String** | The URL to an icon file | +**api_version** | **String** | The API version of this chart | +**app_version** | **String** | The version of the application enclosed in the chart | +**deprecated** | **BOOLEAN** | Whether or not this chart is deprecated | [optional] +**labels** | [**Array<Label>**](Label.md) | A list of label | [optional] +**created** | **String** | The created time of the chart entry | [optional] +**removed** | **BOOLEAN** | A flag to indicate if the chart entry is removed | [optional] +**digest** | **String** | The digest value of the chart entry | [optional] +**urls** | **Array<String>** | The urls of the chart entry | [optional] + + diff --git a/docs/ComponentHealthStatus.md b/docs/ComponentHealthStatus.md new file mode 100644 index 0000000..84be691 --- /dev/null +++ b/docs/ComponentHealthStatus.md @@ -0,0 +1,10 @@ +# Harbor2Client::ComponentHealthStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The component name | [optional] +**status** | **String** | The health status of component | [optional] +**error** | **String** | (optional) The error message when the status is \"unhealthy\" | [optional] + + diff --git a/docs/Configurations.md b/docs/Configurations.md new file mode 100644 index 0000000..41e2759 --- /dev/null +++ b/docs/Configurations.md @@ -0,0 +1,62 @@ +# Harbor2Client::Configurations + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_mode** | **String** | The auth mode of current system, such as \"db_auth\", \"ldap_auth\", \"oidc_auth\" | [optional] +**email_from** | **String** | The sender name for Email notification. | [optional] +**email_host** | **String** | The hostname of SMTP server that sends Email notification. | [optional] +**email_identity** | **String** | By default it's empty so the email_username is picked | [optional] +**email_insecure** | **BOOLEAN** | Whether or not the certificate will be verified when Harbor tries to access the email server. | [optional] +**email_password** | **String** | Email password | [optional] +**email_port** | **Integer** | The port of SMTP server | [optional] +**email_ssl** | **BOOLEAN** | When it''s set to true the system will access Email server via TLS by default. If it''s set to false, it still will handle \"STARTTLS\" from server side. | [optional] +**email_username** | **String** | The username for authenticate against SMTP server | [optional] +**ldap_base_dn** | **String** | The Base DN for LDAP binding. | [optional] +**ldap_filter** | **String** | The filter for LDAP search | [optional] +**ldap_group_base_dn** | **String** | The base DN to search LDAP group. | [optional] +**ldap_group_admin_dn** | **String** | Specify the ldap group which have the same privilege with Harbor admin | [optional] +**ldap_group_attribute_name** | **String** | The attribute which is used as identity of the LDAP group, default is cn.' | [optional] +**ldap_group_search_filter** | **String** | The filter to search the ldap group | [optional] +**ldap_group_search_scope** | **Integer** | The scope to search ldap group. ''0-LDAP_SCOPE_BASE, 1-LDAP_SCOPE_ONELEVEL, 2-LDAP_SCOPE_SUBTREE'' | [optional] +**ldap_scope** | **Integer** | The scope to search ldap users,'0-LDAP_SCOPE_BASE, 1-LDAP_SCOPE_ONELEVEL, 2-LDAP_SCOPE_SUBTREE' | [optional] +**ldap_search_dn** | **String** | The DN of the user to do the search. | [optional] +**ldap_search_password** | **String** | The password of the ldap search dn | [optional] +**ldap_timeout** | **Integer** | Timeout in seconds for connection to LDAP server | [optional] +**ldap_uid** | **String** | The attribute which is used as identity for the LDAP binding, such as \"CN\" or \"SAMAccountname\" | [optional] +**ldap_url** | **String** | The URL of LDAP server | [optional] +**ldap_verify_cert** | **BOOLEAN** | Whether verify your OIDC server certificate, disable it if your OIDC server is hosted via self-hosted certificate. | [optional] +**ldap_group_membership_attribute** | **String** | The user attribute to identify the group membership | [optional] +**project_creation_restriction** | **String** | Indicate who can create projects, it could be ''adminonly'' or ''everyone''. | [optional] +**read_only** | **BOOLEAN** | The flag to indicate whether Harbor is in readonly mode. | [optional] +**self_registration** | **BOOLEAN** | Whether the Harbor instance supports self-registration. If it''s set to false, admin need to add user to the instance. | [optional] +**token_expiration** | **Integer** | The expiration time of the token for internal Registry, in minutes. | [optional] +**uaa_client_id** | **String** | The client id of UAA | [optional] +**uaa_client_secret** | **String** | The client secret of the UAA | [optional] +**uaa_endpoint** | **String** | The endpoint of the UAA | [optional] +**uaa_verify_cert** | **BOOLEAN** | Verify the certificate in UAA server | [optional] +**http_authproxy_endpoint** | **String** | The endpoint of the HTTP auth | [optional] +**http_authproxy_tokenreview_endpoint** | **String** | The token review endpoint | [optional] +**http_authproxy_admin_groups** | **String** | The group which has the harbor admin privileges | [optional] +**http_authproxy_admin_usernames** | **String** | The username which has the harbor admin privileges | [optional] +**http_authproxy_verify_cert** | **BOOLEAN** | Verify the HTTP auth provider's certificate | [optional] +**http_authproxy_skip_search** | **BOOLEAN** | Search user before onboard | [optional] +**http_authproxy_server_certificate** | **String** | The certificate of the HTTP auth provider | [optional] +**oidc_name** | **String** | The OIDC provider name | [optional] +**oidc_endpoint** | **String** | The endpoint of the OIDC provider | [optional] +**oidc_client_id** | **String** | The client ID of the OIDC provider | [optional] +**oidc_client_secret** | **String** | The OIDC provider secret | [optional] +**oidc_groups_claim** | **String** | The attribute claims the group name | [optional] +**oidc_admin_group** | **String** | The OIDC group which has the harbor admin privileges | [optional] +**oidc_scope** | **String** | The scope of the OIDC provider | [optional] +**oidc_user_claim** | **String** | The attribute claims the username | [optional] +**oidc_verify_cert** | **BOOLEAN** | Verify the OIDC provider's certificate' | [optional] +**oidc_auto_onboard** | **BOOLEAN** | Auto onboard the OIDC user | [optional] +**oidc_extra_redirect_parms** | **String** | Extra parameters to add when redirect request to OIDC provider | [optional] +**robot_token_duration** | **Integer** | The robot account token duration in days | [optional] +**robot_name_prefix** | **String** | The rebot account name prefix | [optional] +**notification_enable** | **BOOLEAN** | Enable notification | [optional] +**quota_per_project_enable** | **BOOLEAN** | Enable quota per project | [optional] +**storage_per_project** | **Integer** | The storage quota per project | [optional] + + diff --git a/docs/ConfigurationsResponse.md b/docs/ConfigurationsResponse.md new file mode 100644 index 0000000..f4fe1b6 --- /dev/null +++ b/docs/ConfigurationsResponse.md @@ -0,0 +1,60 @@ +# Harbor2Client::ConfigurationsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_mode** | [**StringConfigItem**](StringConfigItem.md) | The auth mode of current system, such as \"db_auth\", \"ldap_auth\", \"oidc_auth\" | [optional] +**email_from** | [**StringConfigItem**](StringConfigItem.md) | The sender name for Email notification. | [optional] +**email_host** | [**StringConfigItem**](StringConfigItem.md) | The hostname of SMTP server that sends Email notification. | [optional] +**email_identity** | [**StringConfigItem**](StringConfigItem.md) | By default it's empty so the email_username is picked | [optional] +**email_insecure** | [**BoolConfigItem**](BoolConfigItem.md) | Whether or not the certificate will be verified when Harbor tries to access the email server. | [optional] +**email_port** | [**IntegerConfigItem**](IntegerConfigItem.md) | The port of SMTP server | [optional] +**email_ssl** | [**BoolConfigItem**](BoolConfigItem.md) | When it''s set to true the system will access Email server via TLS by default. If it''s set to false, it still will handle \"STARTTLS\" from server side. | [optional] +**email_username** | [**StringConfigItem**](StringConfigItem.md) | The username for authenticate against SMTP server | [optional] +**ldap_base_dn** | [**StringConfigItem**](StringConfigItem.md) | The Base DN for LDAP binding. | [optional] +**ldap_filter** | [**StringConfigItem**](StringConfigItem.md) | The filter for LDAP search | [optional] +**ldap_group_base_dn** | [**StringConfigItem**](StringConfigItem.md) | The base DN to search LDAP group. | [optional] +**ldap_group_admin_dn** | [**StringConfigItem**](StringConfigItem.md) | Specify the ldap group which have the same privilege with Harbor admin | [optional] +**ldap_group_attribute_name** | [**StringConfigItem**](StringConfigItem.md) | The attribute which is used as identity of the LDAP group, default is cn.' | [optional] +**ldap_group_search_filter** | [**StringConfigItem**](StringConfigItem.md) | The filter to search the ldap group | [optional] +**ldap_group_search_scope** | [**IntegerConfigItem**](IntegerConfigItem.md) | The scope to search ldap group. ''0-LDAP_SCOPE_BASE, 1-LDAP_SCOPE_ONELEVEL, 2-LDAP_SCOPE_SUBTREE'' | [optional] +**ldap_scope** | [**IntegerConfigItem**](IntegerConfigItem.md) | The scope to search ldap users,'0-LDAP_SCOPE_BASE, 1-LDAP_SCOPE_ONELEVEL, 2-LDAP_SCOPE_SUBTREE' | [optional] +**ldap_search_dn** | [**StringConfigItem**](StringConfigItem.md) | The DN of the user to do the search. | [optional] +**ldap_timeout** | [**IntegerConfigItem**](IntegerConfigItem.md) | Timeout in seconds for connection to LDAP server | [optional] +**ldap_uid** | [**StringConfigItem**](StringConfigItem.md) | The attribute which is used as identity for the LDAP binding, such as \"CN\" or \"SAMAccountname\" | [optional] +**ldap_url** | [**StringConfigItem**](StringConfigItem.md) | The URL of LDAP server | [optional] +**ldap_verify_cert** | [**BoolConfigItem**](BoolConfigItem.md) | Whether verify your OIDC server certificate, disable it if your OIDC server is hosted via self-hosted certificate. | [optional] +**ldap_group_membership_attribute** | [**StringConfigItem**](StringConfigItem.md) | The user attribute to identify the group membership | [optional] +**project_creation_restriction** | [**StringConfigItem**](StringConfigItem.md) | Indicate who can create projects, it could be ''adminonly'' or ''everyone''. | [optional] +**read_only** | [**BoolConfigItem**](BoolConfigItem.md) | The flag to indicate whether Harbor is in readonly mode. | [optional] +**self_registration** | [**BoolConfigItem**](BoolConfigItem.md) | Whether the Harbor instance supports self-registration. If it''s set to false, admin need to add user to the instance. | [optional] +**token_expiration** | [**IntegerConfigItem**](IntegerConfigItem.md) | The expiration time of the token for internal Registry, in minutes. | [optional] +**uaa_client_id** | [**StringConfigItem**](StringConfigItem.md) | The client id of UAA | [optional] +**uaa_client_secret** | [**StringConfigItem**](StringConfigItem.md) | The client secret of the UAA | [optional] +**uaa_endpoint** | [**StringConfigItem**](StringConfigItem.md) | The endpoint of the UAA | [optional] +**uaa_verify_cert** | [**BoolConfigItem**](BoolConfigItem.md) | Verify the certificate in UAA server | [optional] +**http_authproxy_endpoint** | [**StringConfigItem**](StringConfigItem.md) | The endpoint of the HTTP auth | [optional] +**http_authproxy_tokenreview_endpoint** | [**StringConfigItem**](StringConfigItem.md) | The token review endpoint | [optional] +**http_authproxy_admin_groups** | [**StringConfigItem**](StringConfigItem.md) | The group which has the harbor admin privileges | [optional] +**http_authproxy_admin_usernames** | [**StringConfigItem**](StringConfigItem.md) | The usernames which has the harbor admin privileges | [optional] +**http_authproxy_verify_cert** | [**BoolConfigItem**](BoolConfigItem.md) | Verify the HTTP auth provider's certificate | [optional] +**http_authproxy_skip_search** | [**BoolConfigItem**](BoolConfigItem.md) | Search user before onboard | [optional] +**http_authproxy_server_certificate** | [**StringConfigItem**](StringConfigItem.md) | The certificate of the HTTP auth provider | [optional] +**oidc_name** | [**StringConfigItem**](StringConfigItem.md) | The OIDC provider name | [optional] +**oidc_endpoint** | [**StringConfigItem**](StringConfigItem.md) | The endpoint of the OIDC provider | [optional] +**oidc_client_id** | [**StringConfigItem**](StringConfigItem.md) | The client ID of the OIDC provider | [optional] +**oidc_groups_claim** | [**StringConfigItem**](StringConfigItem.md) | The attribute claims the group name | [optional] +**oidc_admin_group** | [**StringConfigItem**](StringConfigItem.md) | The OIDC group which has the harbor admin privileges | [optional] +**oidc_scope** | [**StringConfigItem**](StringConfigItem.md) | The scope of the OIDC provider | [optional] +**oidc_user_claim** | [**StringConfigItem**](StringConfigItem.md) | The attribute claims the username | [optional] +**oidc_verify_cert** | [**BoolConfigItem**](BoolConfigItem.md) | Verify the OIDC provider's certificate' | [optional] +**oidc_auto_onboard** | [**BoolConfigItem**](BoolConfigItem.md) | Auto onboard the OIDC user | [optional] +**oidc_extra_redirect_parms** | [**StringConfigItem**](StringConfigItem.md) | Extra parameters to add when redirect request to OIDC provider | [optional] +**robot_token_duration** | [**IntegerConfigItem**](IntegerConfigItem.md) | The robot account token duration in days | [optional] +**robot_name_prefix** | [**StringConfigItem**](StringConfigItem.md) | The rebot account name prefix | [optional] +**notification_enable** | [**BoolConfigItem**](BoolConfigItem.md) | Enable notification | [optional] +**quota_per_project_enable** | [**BoolConfigItem**](BoolConfigItem.md) | Enable quota per project | [optional] +**storage_per_project** | [**IntegerConfigItem**](IntegerConfigItem.md) | The storage quota per project | [optional] +**scan_all_policy** | [**ConfigurationsResponseScanAllPolicy**](ConfigurationsResponseScanAllPolicy.md) | | [optional] + + diff --git a/docs/ConfigurationsResponseScanAllPolicy.md b/docs/ConfigurationsResponseScanAllPolicy.md new file mode 100644 index 0000000..d1152df --- /dev/null +++ b/docs/ConfigurationsResponseScanAllPolicy.md @@ -0,0 +1,9 @@ +# Harbor2Client::ConfigurationsResponseScanAllPolicy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | The type of scan all policy, currently the valid values are \"none\" and \"daily\" | [optional] +**parameter** | [**ConfigurationsResponseScanAllPolicyParameter**](ConfigurationsResponseScanAllPolicyParameter.md) | | [optional] + + diff --git a/docs/ConfigurationsResponseScanAllPolicyParameter.md b/docs/ConfigurationsResponseScanAllPolicyParameter.md new file mode 100644 index 0000000..97e74f9 --- /dev/null +++ b/docs/ConfigurationsResponseScanAllPolicyParameter.md @@ -0,0 +1,8 @@ +# Harbor2Client::ConfigurationsResponseScanAllPolicyParameter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**daily_time** | **Integer** | The offset in seconds of UTC 0 o'clock, only valid when the policy type is \"daily\" | [optional] + + diff --git a/docs/ConfigureApi.md b/docs/ConfigureApi.md new file mode 100644 index 0000000..aa8698e --- /dev/null +++ b/docs/ConfigureApi.md @@ -0,0 +1,175 @@ +# Harbor2Client::ConfigureApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_configurations**](ConfigureApi.md#get_configurations) | **GET** /configurations | Get system configurations. +[**get_internalconfig**](ConfigureApi.md#get_internalconfig) | **GET** /internalconfig | Get internal configurations. +[**update_configurations**](ConfigureApi.md#update_configurations) | **PUT** /configurations | Modify system configurations. + + +# **get_configurations** +> ConfigurationsResponse get_configurations(opts) + +Get system configurations. + +This endpoint is for retrieving system configurations that only provides for admin user. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ConfigureApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get system configurations. + result = api_instance.get_configurations(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ConfigureApi->get_configurations: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**ConfigurationsResponse**](ConfigurationsResponse.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_internalconfig** +> InternalConfigurationsResponse get_internalconfig(opts) + +Get internal configurations. + +This endpoint is for retrieving system configurations that only provides for internal api call. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ConfigureApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get internal configurations. + result = api_instance.get_internalconfig(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ConfigureApi->get_internalconfig: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**InternalConfigurationsResponse**](InternalConfigurationsResponse.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_configurations** +> update_configurations(configurations, opts) + +Modify system configurations. + +This endpoint is for modifying system configurations that only provides for admin user. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ConfigureApi.new + +configurations = Harbor2Client::Configurations.new # Configurations | The configuration map can contain a subset of the attributes of the schema, which are to be updated. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Modify system configurations. + api_instance.update_configurations(configurations, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ConfigureApi->update_configurations: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **configurations** | [**Configurations**](Configurations.md)| The configuration map can contain a subset of the attributes of the schema, which are to be updated. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/Endpoint.md b/docs/Endpoint.md new file mode 100644 index 0000000..b60d72a --- /dev/null +++ b/docs/Endpoint.md @@ -0,0 +1,9 @@ +# Harbor2Client::Endpoint + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **String** | The URL of OIDC endpoint to be tested. | [optional] +**verify_cert** | **BOOLEAN** | Whether the certificate should be verified | [optional] + + diff --git a/docs/EventType.md b/docs/EventType.md new file mode 100644 index 0000000..5162c78 --- /dev/null +++ b/docs/EventType.md @@ -0,0 +1,7 @@ +# Harbor2Client::EventType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/FilterStyle.md b/docs/FilterStyle.md new file mode 100644 index 0000000..8915906 --- /dev/null +++ b/docs/FilterStyle.md @@ -0,0 +1,10 @@ +# Harbor2Client::FilterStyle + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | The filter type | [optional] +**style** | **String** | The filter style | [optional] +**values** | **Array<String>** | The filter values | [optional] + + diff --git a/docs/GCHistory.md b/docs/GCHistory.md new file mode 100644 index 0000000..dabcd2f --- /dev/null +++ b/docs/GCHistory.md @@ -0,0 +1,16 @@ +# Harbor2Client::GCHistory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | the id of gc job. | [optional] +**job_name** | **String** | the job name of gc job. | [optional] +**job_kind** | **String** | the job kind of gc job. | [optional] +**job_parameters** | **String** | the job parameters of gc job. | [optional] +**schedule** | [**ScheduleObj**](ScheduleObj.md) | | [optional] +**job_status** | **String** | the status of gc job. | [optional] +**deleted** | **BOOLEAN** | if gc job was deleted. | [optional] +**creation_time** | **DateTime** | the creation time of gc job. | [optional] +**update_time** | **DateTime** | the update time of gc job. | [optional] + + diff --git a/docs/GcApi.md b/docs/GcApi.md new file mode 100644 index 0000000..c8f44bd --- /dev/null +++ b/docs/GcApi.md @@ -0,0 +1,356 @@ +# Harbor2Client::GcApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_gc_schedule**](GcApi.md#create_gc_schedule) | **POST** /system/gc/schedule | Create a gc schedule. +[**get_gc**](GcApi.md#get_gc) | **GET** /system/gc/{gc_id} | Get gc status. +[**get_gc_history**](GcApi.md#get_gc_history) | **GET** /system/gc | Get gc results. +[**get_gc_log**](GcApi.md#get_gc_log) | **GET** /system/gc/{gc_id}/log | Get gc job log. +[**get_gc_schedule**](GcApi.md#get_gc_schedule) | **GET** /system/gc/schedule | Get gc's schedule. +[**update_gc_schedule**](GcApi.md#update_gc_schedule) | **PUT** /system/gc/schedule | Update gc's schedule. + + +# **create_gc_schedule** +> create_gc_schedule(schedule, opts) + +Create a gc schedule. + +This endpoint is for update gc schedule. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::GcApi.new + +schedule = Harbor2Client::Schedule.new # Schedule | Updates of gc's schedule. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Create a gc schedule. + api_instance.create_gc_schedule(schedule, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling GcApi->create_gc_schedule: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **schedule** | [**Schedule**](Schedule.md)| Updates of gc's schedule. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_gc** +> GCHistory get_gc(gc_id, opts) + +Get gc status. + +This endpoint let user get gc status filtered by specific ID. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::GcApi.new + +gc_id = 789 # Integer | The ID of the gc log + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get gc status. + result = api_instance.get_gc(gc_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling GcApi->get_gc: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **gc_id** | **Integer**| The ID of the gc log | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**GCHistory**](GCHistory.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_gc_history** +> Array<GCHistory> get_gc_history(opts) + +Get gc results. + +This endpoint let user get gc execution history. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::GcApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page +} + +begin + #Get gc results. + result = api_instance.get_gc_history(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling GcApi->get_gc_history: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + +### Return type + +[**Array<GCHistory>**](GCHistory.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_gc_log** +> String get_gc_log(gc_id, opts) + +Get gc job log. + +This endpoint let user get gc job logs filtered by specific ID. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::GcApi.new + +gc_id = 789 # Integer | The ID of the gc log + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get gc job log. + result = api_instance.get_gc_log(gc_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling GcApi->get_gc_log: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **gc_id** | **Integer**| The ID of the gc log | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +**String** + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/plain + + + +# **get_gc_schedule** +> GCHistory get_gc_schedule(opts) + +Get gc's schedule. + +This endpoint is for get schedule of gc job. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::GcApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get gc's schedule. + result = api_instance.get_gc_schedule(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling GcApi->get_gc_schedule: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**GCHistory**](GCHistory.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_gc_schedule** +> update_gc_schedule(schedule, opts) + +Update gc's schedule. + +This endpoint is for update gc schedule. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::GcApi.new + +schedule = Harbor2Client::Schedule.new # Schedule | Updates of gc's schedule. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Update gc's schedule. + api_instance.update_gc_schedule(schedule, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling GcApi->update_gc_schedule: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **schedule** | [**Schedule**](Schedule.md)| Updates of gc's schedule. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/GeneralInfo.md b/docs/GeneralInfo.md new file mode 100644 index 0000000..55563cf --- /dev/null +++ b/docs/GeneralInfo.md @@ -0,0 +1,20 @@ +# Harbor2Client::GeneralInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**with_notary** | **BOOLEAN** | If the Harbor instance is deployed with nested notary. | [optional] +**with_chartmuseum** | **BOOLEAN** | If the Harbor instance is deployed with nested chartmuseum. | [optional] +**registry_url** | **String** | The url of registry against which the docker command should be issued. | [optional] +**external_url** | **String** | The external URL of Harbor, with protocol. | [optional] +**auth_mode** | **String** | The auth mode of current Harbor instance. | [optional] +**project_creation_restriction** | **String** | Indicate who can create projects, it could be 'adminonly' or 'everyone'. | [optional] +**self_registration** | **BOOLEAN** | Indicate whether the Harbor instance enable user to register himself. | [optional] +**has_ca_root** | **BOOLEAN** | Indicate whether there is a ca root cert file ready for download in the file system. | [optional] +**harbor_version** | **String** | The build version of Harbor. | [optional] +**registry_storage_provider_name** | **String** | The storage provider's name of Harbor registry | [optional] +**read_only** | **BOOLEAN** | The flag to indicate whether Harbor is in readonly mode. | [optional] +**notification_enable** | **BOOLEAN** | The flag to indicate whether notification mechanism is enabled on Harbor instance. | [optional] +**authproxy_settings** | [**AuthproxySetting**](AuthproxySetting.md) | The setting of auth proxy this is only available when Harbor relies on authproxy for authentication. | [optional] + + diff --git a/docs/HealthApi.md b/docs/HealthApi.md new file mode 100644 index 0000000..cfd083b --- /dev/null +++ b/docs/HealthApi.md @@ -0,0 +1,63 @@ +# Harbor2Client::HealthApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_health**](HealthApi.md#get_health) | **GET** /health | Check the status of Harbor components + + +# **get_health** +> OverallHealthStatus get_health(opts) + +Check the status of Harbor components + +Check the status of Harbor components + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::HealthApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Check the status of Harbor components + result = api_instance.get_health(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling HealthApi->get_health: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**OverallHealthStatus**](OverallHealthStatus.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/ImmutableApi.md b/docs/ImmutableApi.md new file mode 100644 index 0000000..f8568b9 --- /dev/null +++ b/docs/ImmutableApi.md @@ -0,0 +1,261 @@ +# Harbor2Client::ImmutableApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_immu_rule**](ImmutableApi.md#create_immu_rule) | **POST** /projects/{project_name_or_id}/immutabletagrules | Add an immutable tag rule to current project +[**delete_immu_rule**](ImmutableApi.md#delete_immu_rule) | **DELETE** /projects/{project_name_or_id}/immutabletagrules/{immutable_rule_id} | Delete the immutable tag rule. +[**list_immu_rules**](ImmutableApi.md#list_immu_rules) | **GET** /projects/{project_name_or_id}/immutabletagrules | List all immutable tag rules of current project +[**update_immu_rule**](ImmutableApi.md#update_immu_rule) | **PUT** /projects/{project_name_or_id}/immutabletagrules/{immutable_rule_id} | Update the immutable tag rule or enable or disable the rule + + +# **create_immu_rule** +> create_immu_rule(project_name_or_idimmutable_rule, opts) + +Add an immutable tag rule to current project + +This endpoint add an immutable tag rule to the project + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ImmutableApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +immutable_rule = Harbor2Client::ImmutableRule.new # ImmutableRule | + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Add an immutable tag rule to current project + api_instance.create_immu_rule(project_name_or_idimmutable_rule, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ImmutableApi->create_immu_rule: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **immutable_rule** | [**ImmutableRule**](ImmutableRule.md)| | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **delete_immu_rule** +> delete_immu_rule(project_name_or_idimmutable_rule_id, opts) + +Delete the immutable tag rule. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ImmutableApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +immutable_rule_id = 789 # Integer | The ID of the immutable rule + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Delete the immutable tag rule. + api_instance.delete_immu_rule(project_name_or_idimmutable_rule_id, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ImmutableApi->delete_immu_rule: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **immutable_rule_id** | **Integer**| The ID of the immutable rule | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_immu_rules** +> Array<ImmutableRule> list_immu_rules(project_name_or_id, opts) + +List all immutable tag rules of current project + +This endpoint returns the immutable tag rules of a project + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ImmutableApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" +} + +begin + #List all immutable tag rules of current project + result = api_instance.list_immu_rules(project_name_or_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ImmutableApi->list_immu_rules: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + +### Return type + +[**Array<ImmutableRule>**](ImmutableRule.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_immu_rule** +> update_immu_rule(project_name_or_idimmutable_rule_idimmutable_rule, opts) + +Update the immutable tag rule or enable or disable the rule + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ImmutableApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +immutable_rule_id = 789 # Integer | The ID of the immutable rule + +immutable_rule = Harbor2Client::ImmutableRule.new # ImmutableRule | + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Update the immutable tag rule or enable or disable the rule + api_instance.update_immu_rule(project_name_or_idimmutable_rule_idimmutable_rule, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ImmutableApi->update_immu_rule: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **immutable_rule_id** | **Integer**| The ID of the immutable rule | + **immutable_rule** | [**ImmutableRule**](ImmutableRule.md)| | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/ImmutableRule.md b/docs/ImmutableRule.md new file mode 100644 index 0000000..c0af9fb --- /dev/null +++ b/docs/ImmutableRule.md @@ -0,0 +1,15 @@ +# Harbor2Client::ImmutableRule + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**priority** | **Integer** | | [optional] +**disabled** | **BOOLEAN** | | [optional] +**action** | **String** | | [optional] +**template** | **String** | | [optional] +**params** | **Hash<String, Object>** | | [optional] +**tag_selectors** | [**Array<ImmutableSelector>**](ImmutableSelector.md) | | [optional] +**scope_selectors** | **Hash<String, Array<ImmutableSelector>>** | | [optional] + + diff --git a/docs/ImmutableSelector.md b/docs/ImmutableSelector.md new file mode 100644 index 0000000..b36933f --- /dev/null +++ b/docs/ImmutableSelector.md @@ -0,0 +1,11 @@ +# Harbor2Client::ImmutableSelector + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] +**decoration** | **String** | | [optional] +**pattern** | **String** | | [optional] +**extras** | **String** | | [optional] + + diff --git a/docs/IntegerConfigItem.md b/docs/IntegerConfigItem.md new file mode 100644 index 0000000..f21ca44 --- /dev/null +++ b/docs/IntegerConfigItem.md @@ -0,0 +1,9 @@ +# Harbor2Client::IntegerConfigItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **Integer** | The integer value of current config item | [optional] +**editable** | **BOOLEAN** | The configure item can be updated or not | [optional] + + diff --git a/docs/InternalConfigurationsResponse.md b/docs/InternalConfigurationsResponse.md new file mode 100644 index 0000000..bdec29f --- /dev/null +++ b/docs/InternalConfigurationsResponse.md @@ -0,0 +1,7 @@ +# Harbor2Client::InternalConfigurationsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/IsDefault.md b/docs/IsDefault.md new file mode 100644 index 0000000..ceb0ff8 --- /dev/null +++ b/docs/IsDefault.md @@ -0,0 +1,8 @@ +# Harbor2Client::IsDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_default** | **BOOLEAN** | A flag indicating whether a scanner registration is default. | [optional] + + diff --git a/docs/LabelApi.md b/docs/LabelApi.md new file mode 100644 index 0000000..175cbce --- /dev/null +++ b/docs/LabelApi.md @@ -0,0 +1,309 @@ +# Harbor2Client::LabelApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_label**](LabelApi.md#create_label) | **POST** /labels | Post creates a label +[**delete_label**](LabelApi.md#delete_label) | **DELETE** /labels/{label_id} | Delete the label specified by ID. +[**get_label_by_id**](LabelApi.md#get_label_by_id) | **GET** /labels/{label_id} | Get the label specified by ID. +[**list_labels**](LabelApi.md#list_labels) | **GET** /labels | List labels according to the query strings. +[**update_label**](LabelApi.md#update_label) | **PUT** /labels/{label_id} | Update the label properties. + + +# **create_label** +> create_label(label, opts) + +Post creates a label + +This endpoint let user creates a label. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::LabelApi.new + +label = Harbor2Client::Label.new # Label | The json object of label. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Post creates a label + api_instance.create_label(label, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling LabelApi->create_label: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label** | [**Label**](Label.md)| The json object of label. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **delete_label** +> delete_label(label_id, opts) + +Delete the label specified by ID. + +Delete the label specified by ID. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::LabelApi.new + +label_id = 789 # Integer | Label ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Delete the label specified by ID. + api_instance.delete_label(label_id, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling LabelApi->delete_label: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **Integer**| Label ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_label_by_id** +> Label get_label_by_id(label_id, opts) + +Get the label specified by ID. + +This endpoint let user get the label by specific ID. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::LabelApi.new + +label_id = 789 # Integer | Label ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get the label specified by ID. + result = api_instance.get_label_by_id(label_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling LabelApi->get_label_by_id: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **Integer**| Label ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**Label**](Label.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_labels** +> Array<Label> list_labels(opts) + +List labels according to the query strings. + +This endpoint let user list labels by name, scope and project_id + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::LabelApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page + name: 'name_example', # String | The label name. + scope: 'scope_example', # String | The label scope. Valid values are g and p. g for global labels and p for project labels. + project_id: 789 # Integer | Relevant project ID, required when scope is p. +} + +begin + #List labels according to the query strings. + result = api_instance.list_labels(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling LabelApi->list_labels: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + **name** | **String**| The label name. | [optional] + **scope** | **String**| The label scope. Valid values are g and p. g for global labels and p for project labels. | [optional] + **project_id** | **Integer**| Relevant project ID, required when scope is p. | [optional] + +### Return type + +[**Array<Label>**](Label.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_label** +> update_label(label_idlabel, opts) + +Update the label properties. + +This endpoint let user update label properties. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::LabelApi.new + +label_id = 789 # Integer | Label ID + +label = Harbor2Client::Label.new # Label | The updated label json object. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Update the label properties. + api_instance.update_label(label_idlabel, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling LabelApi->update_label: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **Integer**| Label ID | + **label** | [**Label**](Label.md)| The updated label json object. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/LdapApi.md b/docs/LdapApi.md new file mode 100644 index 0000000..41b85b7 --- /dev/null +++ b/docs/LdapApi.md @@ -0,0 +1,238 @@ +# Harbor2Client::LdapApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**import_ldap_user**](LdapApi.md#import_ldap_user) | **POST** /ldap/users/import | Import selected available ldap users. +[**ping_ldap**](LdapApi.md#ping_ldap) | **POST** /ldap/ping | Ping available ldap service. +[**search_ldap_group**](LdapApi.md#search_ldap_group) | **GET** /ldap/groups/search | Search available ldap groups. +[**search_ldap_user**](LdapApi.md#search_ldap_user) | **GET** /ldap/users/search | Search available ldap users. + + +# **import_ldap_user** +> import_ldap_user(uid_list, opts) + +Import selected available ldap users. + +This endpoint adds the selected available ldap users to harbor based on related configuration parameters from the system. System will try to guess the user email address and realname, add to harbor user information. If have errors when import user, will return the list of importing failed uid and the failed reason. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::LdapApi.new + +uid_list = Harbor2Client::LdapImportUsers.new # LdapImportUsers | The uid listed for importing. This list will check users validity of ldap service based on configuration from the system. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Import selected available ldap users. + api_instance.import_ldap_user(uid_list, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling LdapApi->import_ldap_user: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uid_list** | [**LdapImportUsers**](LdapImportUsers.md)| The uid listed for importing. This list will check users validity of ldap service based on configuration from the system. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **ping_ldap** +> LdapPingResult ping_ldap(opts) + +Ping available ldap service. + +This endpoint ping the available ldap service for test related configuration parameters. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::LdapApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + ldapconf: Harbor2Client::LdapConf.new # LdapConf | ldap configuration. support input ldap service configuration. If it is a empty request, will load current configuration from the system. +} + +begin + #Ping available ldap service. + result = api_instance.ping_ldap(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling LdapApi->ping_ldap: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **ldapconf** | [**LdapConf**](LdapConf.md)| ldap configuration. support input ldap service configuration. If it is a empty request, will load current configuration from the system. | [optional] + +### Return type + +[**LdapPingResult**](LdapPingResult.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **search_ldap_group** +> Array<UserGroup> search_ldap_group(opts) + +Search available ldap groups. + +This endpoint searches the available ldap groups based on related configuration parameters. support to search by groupname or groupdn. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::LdapApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + groupname: 'groupname_example', # String | Ldap group name + groupdn: 'groupdn_example' # String | The LDAP group DN +} + +begin + #Search available ldap groups. + result = api_instance.search_ldap_group(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling LdapApi->search_ldap_group: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **groupname** | **String**| Ldap group name | [optional] + **groupdn** | **String**| The LDAP group DN | [optional] + +### Return type + +[**Array<UserGroup>**](UserGroup.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **search_ldap_user** +> Array<LdapUser> search_ldap_user(opts) + +Search available ldap users. + +This endpoint searches the available ldap users based on related configuration parameters. Support searched by input ladp configuration, load configuration from the system and specific filter. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::LdapApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + username: 'username_example' # String | Registered user ID +} + +begin + #Search available ldap users. + result = api_instance.search_ldap_user(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling LdapApi->search_ldap_user: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **username** | **String**| Registered user ID | [optional] + +### Return type + +[**Array<LdapUser>**](LdapUser.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/LdapConf.md b/docs/LdapConf.md new file mode 100644 index 0000000..fc8f1e6 --- /dev/null +++ b/docs/LdapConf.md @@ -0,0 +1,16 @@ +# Harbor2Client::LdapConf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ldap_url** | **String** | The url of ldap service. | [optional] +**ldap_search_dn** | **String** | The search dn of ldap service. | [optional] +**ldap_search_password** | **String** | The search password of ldap service. | [optional] +**ldap_base_dn** | **String** | The base dn of ldap service. | [optional] +**ldap_filter** | **String** | The serach filter of ldap service. | [optional] +**ldap_uid** | **String** | The serach uid from ldap service attributes. | [optional] +**ldap_scope** | **Integer** | The serach scope of ldap service. | [optional] +**ldap_connection_timeout** | **Integer** | The connect timeout of ldap service(second). | [optional] +**ldap_verify_cert** | **BOOLEAN** | Verify Ldap server certificate. | [optional] + + diff --git a/docs/LdapFailedImportUser.md b/docs/LdapFailedImportUser.md new file mode 100644 index 0000000..ae822c0 --- /dev/null +++ b/docs/LdapFailedImportUser.md @@ -0,0 +1,9 @@ +# Harbor2Client::LdapFailedImportUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uid** | **String** | the uid can't add to system. | [optional] +**error** | **String** | fail reason. | [optional] + + diff --git a/docs/LdapImportUsers.md b/docs/LdapImportUsers.md new file mode 100644 index 0000000..df06c34 --- /dev/null +++ b/docs/LdapImportUsers.md @@ -0,0 +1,8 @@ +# Harbor2Client::LdapImportUsers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ldap_uid_list** | **Array<String>** | selected uid list | [optional] + + diff --git a/docs/LdapPingResult.md b/docs/LdapPingResult.md new file mode 100644 index 0000000..a9fdccc --- /dev/null +++ b/docs/LdapPingResult.md @@ -0,0 +1,9 @@ +# Harbor2Client::LdapPingResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **BOOLEAN** | Test success | [optional] +**message** | **String** | The ping operation output message. | [optional] + + diff --git a/docs/LdapUser.md b/docs/LdapUser.md new file mode 100644 index 0000000..4958526 --- /dev/null +++ b/docs/LdapUser.md @@ -0,0 +1,10 @@ +# Harbor2Client::LdapUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **String** | ldap username. | [optional] +**realname** | **String** | The user realname from \"uid\" or \"cn\" attribute. | [optional] +**email** | **String** | The user email address from \"mail\" or \"email\" attribute. | [optional] + + diff --git a/docs/MemberApi.md b/docs/MemberApi.md new file mode 100644 index 0000000..4d33a8a --- /dev/null +++ b/docs/MemberApi.md @@ -0,0 +1,322 @@ +# Harbor2Client::MemberApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_project_member**](MemberApi.md#create_project_member) | **POST** /projects/{project_name_or_id}/members | Create project member +[**delete_project_member**](MemberApi.md#delete_project_member) | **DELETE** /projects/{project_name_or_id}/members/{mid} | Delete project member +[**get_project_member**](MemberApi.md#get_project_member) | **GET** /projects/{project_name_or_id}/members/{mid} | Get the project member information +[**list_project_members**](MemberApi.md#list_project_members) | **GET** /projects/{project_name_or_id}/members | Get all project member information +[**update_project_member**](MemberApi.md#update_project_member) | **PUT** /projects/{project_name_or_id}/members/{mid} | Update project member + + +# **create_project_member** +> create_project_member(project_name_or_id, opts) + +Create project member + +Create project member relationship, the member can be one of the user_member and group_member, The user_member need to specify user_id or username. If the user already exist in harbor DB, specify the user_id, If does not exist in harbor DB, it will SearchAndOnBoard the user. The group_member need to specify id or ldap_group_dn. If the group already exist in harbor DB. specify the user group's id, If does not exist, it will SearchAndOnBoard the group. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::MemberApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + project_member: Harbor2Client::ProjectMember.new # ProjectMember | +} + +begin + #Create project member + api_instance.create_project_member(project_name_or_id, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling MemberApi->create_project_member: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + **project_member** | [**ProjectMember**](ProjectMember.md)| | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **delete_project_member** +> delete_project_member(project_name_or_idmid, opts) + +Delete project member + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::MemberApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +mid = 789 # Integer | Member ID. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Delete project member + api_instance.delete_project_member(project_name_or_idmid, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling MemberApi->delete_project_member: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **mid** | **Integer**| Member ID. | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_project_member** +> ProjectMemberEntity get_project_member(project_name_or_idmid, opts) + +Get the project member information + +Get the project member information + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::MemberApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +mid = 789 # Integer | The member ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Get the project member information + result = api_instance.get_project_member(project_name_or_idmid, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling MemberApi->get_project_member: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **mid** | **Integer**| The member ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +[**ProjectMemberEntity**](ProjectMemberEntity.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_project_members** +> Array<ProjectMemberEntity> list_project_members(project_name_or_id, opts) + +Get all project member information + +Get all project member information + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::MemberApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page + entityname: 'entityname_example' # String | The entity name to search. +} + +begin + #Get all project member information + result = api_instance.list_project_members(project_name_or_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling MemberApi->list_project_members: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + **entityname** | **String**| The entity name to search. | [optional] + +### Return type + +[**Array<ProjectMemberEntity>**](ProjectMemberEntity.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_project_member** +> update_project_member(project_name_or_idmid, opts) + +Update project member + +Update project member relationship + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::MemberApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +mid = 789 # Integer | Member ID. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + role: Harbor2Client::RoleRequest.new # RoleRequest | +} + +begin + #Update project member + api_instance.update_project_member(project_name_or_idmid, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling MemberApi->update_project_member: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **mid** | **Integer**| Member ID. | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + **role** | [**RoleRequest**](RoleRequest.md)| | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/NativeReportSummary.md b/docs/NativeReportSummary.md index e1ea308..1fab5cd 100644 --- a/docs/NativeReportSummary.md +++ b/docs/NativeReportSummary.md @@ -11,5 +11,6 @@ Name | Type | Description | Notes **start_time** | **DateTime** | The start time of the scan process that generating report | [optional] **end_time** | **DateTime** | The end time of the scan process that generating report | [optional] **complete_percent** | **Integer** | The complete percent of the scanning which value is between 0 and 100 | [optional] +**scanner** | [**Scanner**](Scanner.md) | | [optional] diff --git a/docs/NotifyType.md b/docs/NotifyType.md new file mode 100644 index 0000000..7f7af72 --- /dev/null +++ b/docs/NotifyType.md @@ -0,0 +1,7 @@ +# Harbor2Client::NotifyType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/OIDCCliSecretReq.md b/docs/OIDCCliSecretReq.md new file mode 100644 index 0000000..e6dda6c --- /dev/null +++ b/docs/OIDCCliSecretReq.md @@ -0,0 +1,8 @@ +# Harbor2Client::OIDCCliSecretReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**secret** | **String** | The new secret | [optional] + + diff --git a/docs/OIDCUserInfo.md b/docs/OIDCUserInfo.md new file mode 100644 index 0000000..5318262 --- /dev/null +++ b/docs/OIDCUserInfo.md @@ -0,0 +1,13 @@ +# Harbor2Client::OIDCUserInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | the ID of the OIDC info record | [optional] +**user_id** | **Integer** | the ID of the user | [optional] +**subiss** | **String** | the concatenation of sub and issuer in the ID token | [optional] +**secret** | **String** | the secret of the OIDC user that can be used for CLI to push/pull artifacts | [optional] +**creation_time** | **DateTime** | The creation time of the OIDC user info record. | [optional] +**update_time** | **DateTime** | The update time of the OIDC user info record. | [optional] + + diff --git a/docs/OidcApi.md b/docs/OidcApi.md new file mode 100644 index 0000000..3129156 --- /dev/null +++ b/docs/OidcApi.md @@ -0,0 +1,65 @@ +# Harbor2Client::OidcApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ping_oidc**](OidcApi.md#ping_oidc) | **POST** /system/oidc/ping | Test the OIDC endpoint. + + +# **ping_oidc** +> ping_oidc(endpoint, opts) + +Test the OIDC endpoint. + +Test the OIDC endpoint, the setting of the endpoint is provided in the request. This API can only be called by system admin. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::OidcApi.new + +endpoint = Harbor2Client::Endpoint.new # Endpoint | Request body for OIDC endpoint to be tested. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Test the OIDC endpoint. + api_instance.ping_oidc(endpoint, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling OidcApi->ping_oidc: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **endpoint** | [**Endpoint**](Endpoint.md)| Request body for OIDC endpoint to be tested. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/OverallHealthStatus.md b/docs/OverallHealthStatus.md new file mode 100644 index 0000000..08f8040 --- /dev/null +++ b/docs/OverallHealthStatus.md @@ -0,0 +1,9 @@ +# Harbor2Client::OverallHealthStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **String** | The overall health status. It is \"healthy\" only when all the components' status are \"healthy\" | [optional] +**components** | [**Array<ComponentHealthStatus>**](ComponentHealthStatus.md) | | [optional] + + diff --git a/docs/PasswordReq.md b/docs/PasswordReq.md new file mode 100644 index 0000000..f6bbe22 --- /dev/null +++ b/docs/PasswordReq.md @@ -0,0 +1,9 @@ +# Harbor2Client::PasswordReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**old_password** | **String** | The user's existing password. | [optional] +**new_password** | **String** | New password for marking as to be updated. | [optional] + + diff --git a/docs/Permission.md b/docs/Permission.md new file mode 100644 index 0000000..dc2e6d8 --- /dev/null +++ b/docs/Permission.md @@ -0,0 +1,9 @@ +# Harbor2Client::Permission + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource** | **String** | The permission resoruce | [optional] +**action** | **String** | The permission action | [optional] + + diff --git a/docs/PingApi.md b/docs/PingApi.md new file mode 100644 index 0000000..55466b4 --- /dev/null +++ b/docs/PingApi.md @@ -0,0 +1,63 @@ +# Harbor2Client::PingApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_ping**](PingApi.md#get_ping) | **GET** /ping | Ping Harbor to check if it's alive. + + +# **get_ping** +> String get_ping(opts) + +Ping Harbor to check if it's alive. + +This API simply replies a pong to indicate the process to handle API is up, disregarding the health status of dependent components. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::PingApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Ping Harbor to check if it's alive. + result = api_instance.get_ping(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling PingApi->get_ping: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +**String** + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/plain + + + diff --git a/docs/PreheatApi.md b/docs/PreheatApi.md index dc47512..07168a3 100644 --- a/docs/PreheatApi.md +++ b/docs/PreheatApi.md @@ -529,7 +529,8 @@ opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request page: 1, # Integer | The page number page_size: 10, # Integer | The size of per page - q: 'q_example' # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" } begin @@ -551,6 +552,7 @@ Name | Type | Description | Notes **page** | **Integer**| The page number | [optional] [default to 1] **page_size** | **Integer**| The size of per page | [optional] [default to 10] **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] ### Return type @@ -591,7 +593,8 @@ opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request page: 1, # Integer | The page number page_size: 10, # Integer | The size of per page - q: 'q_example' # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" } begin @@ -611,6 +614,7 @@ Name | Type | Description | Notes **page** | **Integer**| The page number | [optional] [default to 1] **page_size** | **Integer**| The size of per page | [optional] [default to 10] **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] ### Return type @@ -653,7 +657,8 @@ opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request page: 1, # Integer | The page number page_size: 10, # Integer | The size of per page - q: 'q_example' # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" } begin @@ -674,6 +679,7 @@ Name | Type | Description | Notes **page** | **Integer**| The page number | [optional] [default to 1] **page_size** | **Integer**| The size of per page | [optional] [default to 10] **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] ### Return type @@ -831,7 +837,8 @@ opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request page: 1, # Integer | The page number page_size: 10, # Integer | The size of per page - q: 'q_example' # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" } begin @@ -854,6 +861,7 @@ Name | Type | Description | Notes **page** | **Integer**| The page number | [optional] [default to 1] **page_size** | **Integer**| The size of per page | [optional] [default to 10] **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] ### Return type diff --git a/docs/ProjectApi.md b/docs/ProjectApi.md index 7134438..b05ec0c 100644 --- a/docs/ProjectApi.md +++ b/docs/ProjectApi.md @@ -5,14 +5,17 @@ All URIs are relative to *http://localhost/api/v2.0* Method | HTTP request | Description ------------- | ------------- | ------------- [**create_project**](ProjectApi.md#create_project) | **POST** /projects | Create a new project. -[**delete_project**](ProjectApi.md#delete_project) | **DELETE** /projects/{project_id} | Delete project by projectID +[**delete_project**](ProjectApi.md#delete_project) | **DELETE** /projects/{project_name_or_id} | Delete project by projectID [**get_logs**](ProjectApi.md#get_logs) | **GET** /projects/{project_name}/logs | Get recent logs of the projects -[**get_project**](ProjectApi.md#get_project) | **GET** /projects/{project_id} | Return specific project detail information -[**get_project_deletable**](ProjectApi.md#get_project_deletable) | **GET** /projects/{project_id}/_deletable | Get the deletable status of the project -[**get_project_summary**](ProjectApi.md#get_project_summary) | **GET** /projects/{project_id}/summary | Get summary of the project. +[**get_project**](ProjectApi.md#get_project) | **GET** /projects/{project_name_or_id} | Return specific project detail information +[**get_project_deletable**](ProjectApi.md#get_project_deletable) | **GET** /projects/{project_name_or_id}/_deletable | Get the deletable status of the project +[**get_project_summary**](ProjectApi.md#get_project_summary) | **GET** /projects/{project_name_or_id}/summary | Get summary of the project. +[**get_scanner_of_project**](ProjectApi.md#get_scanner_of_project) | **GET** /projects/{project_name_or_id}/scanner | Get project level scanner [**head_project**](ProjectApi.md#head_project) | **HEAD** /projects | Check if the project name user provided already exists. [**list_projects**](ProjectApi.md#list_projects) | **GET** /projects | List projects -[**update_project**](ProjectApi.md#update_project) | **PUT** /projects/{project_id} | Update properties for a selected project. +[**list_scanner_candidates_of_project**](ProjectApi.md#list_scanner_candidates_of_project) | **GET** /projects/{project_name_or_id}/scanner/candidates | Get scanner registration candidates for configurating project level scanner +[**set_scanner_of_project**](ProjectApi.md#set_scanner_of_project) | **PUT** /projects/{project_name_or_id}/scanner | Configure scanner for the specified project +[**update_project**](ProjectApi.md#update_project) | **PUT** /projects/{project_name_or_id} | Update properties for a selected project. # **create_project** @@ -39,6 +42,7 @@ project = Harbor2Client::ProjectReq.new # ProjectReq | New created project. opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_resource_name_in_location: false # BOOLEAN | The flag to indicate whether to return the name of the resource in Location. When X-Resource-Name-In-Location is true, the Location will return the name of the resource. } begin @@ -55,6 +59,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project** | [**ProjectReq**](ProjectReq.md)| New created project. | **x_request_id** | **String**| An unique ID for the request | [optional] + **x_resource_name_in_location** | **BOOLEAN**| The flag to indicate whether to return the name of the resource in Location. When X-Resource-Name-In-Location is true, the Location will return the name of the resource. | [optional] [default to false] ### Return type @@ -72,7 +77,7 @@ nil (empty response body) # **delete_project** -> delete_project(project_id, opts) +> delete_project(project_name_or_id, opts) Delete project by projectID @@ -91,15 +96,16 @@ end api_instance = Harbor2Client::ProjectApi.new -project_id = 789 # Integer | The ID of the project +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. } begin #Delete project by projectID - api_instance.delete_project(project_id, opts) + api_instance.delete_project(project_name_or_id, opts) rescue Harbor2Client::ApiError => e puts "Exception when calling ProjectApi->delete_project: #{e}" end @@ -109,8 +115,9 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **project_id** | **Integer**| The ID of the project | + **project_name_or_id** | **String**| The name or id of the project | **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] ### Return type @@ -151,7 +158,8 @@ project_name = 'project_name_example' # String | The name of the project opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request - q: 'q_example' # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" page: 1, # Integer | The page number page_size: 10, # Integer | The size of per page } @@ -172,6 +180,7 @@ Name | Type | Description | Notes **project_name** | **String**| The name of the project | **x_request_id** | **String**| An unique ID for the request | [optional] **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] **page** | **Integer**| The page number | [optional] [default to 1] **page_size** | **Integer**| The size of per page | [optional] [default to 10] @@ -191,7 +200,7 @@ Name | Type | Description | Notes # **get_project** -> Project get_project(project_id, opts) +> Project get_project(project_name_or_id, opts) Return specific project detail information @@ -210,15 +219,16 @@ end api_instance = Harbor2Client::ProjectApi.new -project_id = 789 # Integer | The ID of the project +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. } begin #Return specific project detail information - result = api_instance.get_project(project_id, opts) + result = api_instance.get_project(project_name_or_id, opts) p result rescue Harbor2Client::ApiError => e puts "Exception when calling ProjectApi->get_project: #{e}" @@ -229,8 +239,9 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **project_id** | **Integer**| The ID of the project | + **project_name_or_id** | **String**| The name or id of the project | **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] ### Return type @@ -248,7 +259,7 @@ Name | Type | Description | Notes # **get_project_deletable** -> ProjectDeletable get_project_deletable(project_id, opts) +> ProjectDeletable get_project_deletable(project_name_or_id, opts) Get the deletable status of the project @@ -267,15 +278,16 @@ end api_instance = Harbor2Client::ProjectApi.new -project_id = 789 # Integer | The ID of the project +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. } begin #Get the deletable status of the project - result = api_instance.get_project_deletable(project_id, opts) + result = api_instance.get_project_deletable(project_name_or_id, opts) p result rescue Harbor2Client::ApiError => e puts "Exception when calling ProjectApi->get_project_deletable: #{e}" @@ -286,8 +298,9 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **project_id** | **Integer**| The ID of the project | + **project_name_or_id** | **String**| The name or id of the project | **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] ### Return type @@ -305,7 +318,7 @@ Name | Type | Description | Notes # **get_project_summary** -> ProjectSummary get_project_summary(project_id, opts) +> ProjectSummary get_project_summary(project_name_or_id, opts) Get summary of the project. @@ -324,15 +337,16 @@ end api_instance = Harbor2Client::ProjectApi.new -project_id = 789 # Integer | The ID of the project +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. } begin #Get summary of the project. - result = api_instance.get_project_summary(project_id, opts) + result = api_instance.get_project_summary(project_name_or_id, opts) p result rescue Harbor2Client::ApiError => e puts "Exception when calling ProjectApi->get_project_summary: #{e}" @@ -343,8 +357,9 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **project_id** | **Integer**| The ID of the project | + **project_name_or_id** | **String**| The name or id of the project | **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] ### Return type @@ -361,6 +376,65 @@ Name | Type | Description | Notes +# **get_scanner_of_project** +> ScannerRegistration get_scanner_of_project(project_name_or_id, opts) + +Get project level scanner + +Get the scanner registration of the specified project. If no scanner registration is configured for the specified project, the system default scanner registration will be returned. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ProjectApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Get project level scanner + result = api_instance.get_scanner_of_project(project_name_or_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ProjectApi->get_scanner_of_project: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +[**ScannerRegistration**](ScannerRegistration.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + # **head_project** > head_project(project_name, opts) @@ -439,11 +513,14 @@ api_instance = Harbor2Client::ProjectApi.new opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] page: 1, # Integer | The page number page_size: 10, # Integer | The size of per page + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" name: 'name_example', # String | The name of project. public: true, # BOOLEAN | The project is public or private. - owner: 'owner_example' # String | The name of project owner. + owner: 'owner_example', # String | The name of project owner. + with_detail: true # BOOLEAN | Bool value indicating whether return detailed information of the project } begin @@ -460,11 +537,14 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **x_request_id** | **String**| An unique ID for the request | [optional] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] **page** | **Integer**| The page number | [optional] [default to 1] **page_size** | **Integer**| The size of per page | [optional] [default to 10] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] **name** | **String**| The name of project. | [optional] **public** | **BOOLEAN**| The project is public or private. | [optional] **owner** | **String**| The name of project owner. | [optional] + **with_detail** | **BOOLEAN**| Bool value indicating whether return detailed information of the project | [optional] [default to true] ### Return type @@ -481,8 +561,136 @@ Name | Type | Description | Notes +# **list_scanner_candidates_of_project** +> Array<ScannerRegistration> list_scanner_candidates_of_project(project_name_or_id, opts) + +Get scanner registration candidates for configurating project level scanner + +Retrieve the system configured scanner registrations as candidates of setting project level scanner. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ProjectApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page +} + +begin + #Get scanner registration candidates for configurating project level scanner + result = api_instance.list_scanner_candidates_of_project(project_name_or_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ProjectApi->list_scanner_candidates_of_project: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + +### Return type + +[**Array<ScannerRegistration>**](ScannerRegistration.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **set_scanner_of_project** +> set_scanner_of_project(project_name_or_idpayload, opts) + +Configure scanner for the specified project + +Set one of the system configured scanner registration as the indepndent scanner of the specified project. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ProjectApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +payload = Harbor2Client::ProjectScanner.new # ProjectScanner | + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Configure scanner for the specified project + api_instance.set_scanner_of_project(project_name_or_idpayload, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ProjectApi->set_scanner_of_project: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **payload** | [**ProjectScanner**](ProjectScanner.md)| | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + # **update_project** -> update_project(project_idproject, opts) +> update_project(project_name_or_idproject, opts) Update properties for a selected project. @@ -501,17 +709,18 @@ end api_instance = Harbor2Client::ProjectApi.new -project_id = 789 # Integer | The ID of the project +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project project = Harbor2Client::ProjectReq.new # ProjectReq | Updates of project. opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. } begin #Update properties for a selected project. - api_instance.update_project(project_idproject, opts) + api_instance.update_project(project_name_or_idproject, opts) rescue Harbor2Client::ApiError => e puts "Exception when calling ProjectApi->update_project: #{e}" end @@ -521,9 +730,10 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **project_id** | **Integer**| The ID of the project | + **project_name_or_id** | **String**| The name or id of the project | **project** | [**ProjectReq**](ProjectReq.md)| Updates of project. | **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] ### Return type diff --git a/docs/ProjectMember.md b/docs/ProjectMember.md new file mode 100644 index 0000000..4f06e61 --- /dev/null +++ b/docs/ProjectMember.md @@ -0,0 +1,10 @@ +# Harbor2Client::ProjectMember + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_id** | **Integer** | The role id 1 for projectAdmin, 2 for developer, 3 for guest, 4 for maintainer | [optional] +**member_user** | [**UserEntity**](UserEntity.md) | | [optional] +**member_group** | [**UserGroup**](UserGroup.md) | | [optional] + + diff --git a/docs/ProjectMemberEntity.md b/docs/ProjectMemberEntity.md new file mode 100644 index 0000000..eed89db --- /dev/null +++ b/docs/ProjectMemberEntity.md @@ -0,0 +1,14 @@ +# Harbor2Client::ProjectMemberEntity + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | the project member id | [optional] +**project_id** | **Integer** | the project id | [optional] +**entity_name** | **String** | the name of the group member. | [optional] +**role_name** | **String** | the name of the role | [optional] +**role_id** | **Integer** | the role id | [optional] +**entity_id** | **Integer** | the id of entity, if the member is a user, it is user_id in user table. if the member is a user group, it is the user group's ID in user_group table. | [optional] +**entity_type** | **String** | the entity's type, u for user entity, g for group entity. | [optional] + + diff --git a/docs/ProjectMetadataApi.md b/docs/ProjectMetadataApi.md new file mode 100644 index 0000000..62a60db --- /dev/null +++ b/docs/ProjectMetadataApi.md @@ -0,0 +1,318 @@ +# Harbor2Client::ProjectMetadataApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_project_metadatas**](ProjectMetadataApi.md#add_project_metadatas) | **POST** /projects/{project_name_or_id}/metadatas/ | Add metadata for the specific project +[**delete_project_metadata**](ProjectMetadataApi.md#delete_project_metadata) | **DELETE** /projects/{project_name_or_id}/metadatas/{meta_name} | Delete the specific metadata for the specific project +[**get_project_metadata**](ProjectMetadataApi.md#get_project_metadata) | **GET** /projects/{project_name_or_id}/metadatas/{meta_name} | Get the specific metadata of the specific project +[**list_project_metadatas**](ProjectMetadataApi.md#list_project_metadatas) | **GET** /projects/{project_name_or_id}/metadatas/ | Get the metadata of the specific project +[**update_project_metadata**](ProjectMetadataApi.md#update_project_metadata) | **PUT** /projects/{project_name_or_id}/metadatas/{meta_name} | Update the specific metadata for the specific project + + +# **add_project_metadatas** +> add_project_metadatas(project_name_or_id, opts) + +Add metadata for the specific project + +Add metadata for the specific project + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ProjectMetadataApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + metadata: nil # Object | +} + +begin + #Add metadata for the specific project + api_instance.add_project_metadatas(project_name_or_id, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ProjectMetadataApi->add_project_metadatas: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + **metadata** | **Object**| | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **delete_project_metadata** +> delete_project_metadata(project_name_or_idmeta_name, opts) + +Delete the specific metadata for the specific project + +Delete the specific metadata for the specific project + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ProjectMetadataApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +meta_name = 'meta_name_example' # String | The name of metadata. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Delete the specific metadata for the specific project + api_instance.delete_project_metadata(project_name_or_idmeta_name, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ProjectMetadataApi->delete_project_metadata: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **meta_name** | **String**| The name of metadata. | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_project_metadata** +> Hash<String, String> get_project_metadata(project_name_or_idmeta_name, opts) + +Get the specific metadata of the specific project + +Get the specific metadata of the specific project + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ProjectMetadataApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +meta_name = 'meta_name_example' # String | The name of metadata. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Get the specific metadata of the specific project + result = api_instance.get_project_metadata(project_name_or_idmeta_name, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ProjectMetadataApi->get_project_metadata: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **meta_name** | **String**| The name of metadata. | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +**Hash<String, String>** + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_project_metadatas** +> Hash<String, String> list_project_metadatas(project_name_or_id, opts) + +Get the metadata of the specific project + +Get the metadata of the specific project + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ProjectMetadataApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Get the metadata of the specific project + result = api_instance.list_project_metadatas(project_name_or_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ProjectMetadataApi->list_project_metadatas: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +**Hash<String, String>** + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_project_metadata** +> update_project_metadata(project_name_or_idmeta_name, opts) + +Update the specific metadata for the specific project + +Update the specific metadata for the specific project + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ProjectMetadataApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +meta_name = 'meta_name_example' # String | The name of metadata. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + metadata: nil # Object | +} + +begin + #Update the specific metadata for the specific project + api_instance.update_project_metadata(project_name_or_idmeta_name, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ProjectMetadataApi->update_project_metadata: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **meta_name** | **String**| The name of metadata. | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + **metadata** | **Object**| | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/ProjectScanner.md b/docs/ProjectScanner.md new file mode 100644 index 0000000..6a136db --- /dev/null +++ b/docs/ProjectScanner.md @@ -0,0 +1,8 @@ +# Harbor2Client::ProjectScanner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | The identifier of the scanner registration | + + diff --git a/docs/Quota.md b/docs/Quota.md new file mode 100644 index 0000000..be39171 --- /dev/null +++ b/docs/Quota.md @@ -0,0 +1,13 @@ +# Harbor2Client::Quota + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | ID of the quota | [optional] +**ref** | [**QuotaRefObject**](QuotaRefObject.md) | The reference object of the quota | [optional] +**hard** | [**ResourceList**](ResourceList.md) | The hard limits of the quota | [optional] +**used** | [**ResourceList**](ResourceList.md) | The used status of the quota | [optional] +**creation_time** | **DateTime** | the creation time of the quota | [optional] +**update_time** | **DateTime** | the update time of the quota | [optional] + + diff --git a/docs/QuotaApi.md b/docs/QuotaApi.md new file mode 100644 index 0000000..ea47872 --- /dev/null +++ b/docs/QuotaApi.md @@ -0,0 +1,191 @@ +# Harbor2Client::QuotaApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_quota**](QuotaApi.md#get_quota) | **GET** /quotas/{id} | Get the specified quota +[**list_quotas**](QuotaApi.md#list_quotas) | **GET** /quotas | List quotas +[**update_quota**](QuotaApi.md#update_quota) | **PUT** /quotas/{id} | Update the specified quota + + +# **get_quota** +> Quota get_quota(id, opts) + +Get the specified quota + +Get the specified quota + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::QuotaApi.new + +id = 56 # Integer | Quota ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get the specified quota + result = api_instance.get_quota(id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling QuotaApi->get_quota: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Quota ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**Quota**](Quota.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_quotas** +> Array<Quota> list_quotas(opts) + +List quotas + +List quotas + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::QuotaApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page + reference: 'reference_example', # String | The reference type of quota. + reference_id: 'reference_id_example', # String | The reference id of quota. + sort: 'sort_example' # String | Sort method, valid values include: 'hard.resource_name', '-hard.resource_name', 'used.resource_name', '-used.resource_name'. Here '-' stands for descending order, resource_name should be the real resource name of the quota. +} + +begin + #List quotas + result = api_instance.list_quotas(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling QuotaApi->list_quotas: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + **reference** | **String**| The reference type of quota. | [optional] + **reference_id** | **String**| The reference id of quota. | [optional] + **sort** | **String**| Sort method, valid values include: 'hard.resource_name', '-hard.resource_name', 'used.resource_name', '-used.resource_name'. Here '-' stands for descending order, resource_name should be the real resource name of the quota. | [optional] + +### Return type + +[**Array<Quota>**](Quota.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_quota** +> update_quota(id, hard, opts) + +Update the specified quota + +Update hard limits of the specified quota + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::QuotaApi.new + +id = 56 # Integer | Quota ID + +hard = Harbor2Client::QuotaUpdateReq.new # QuotaUpdateReq | The new hard limits for the quota + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Update the specified quota + api_instance.update_quota(id, hard, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling QuotaApi->update_quota: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Quota ID | + **hard** | [**QuotaUpdateReq**](QuotaUpdateReq.md)| The new hard limits for the quota | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/QuotaRefObject.md b/docs/QuotaRefObject.md new file mode 100644 index 0000000..29cf317 --- /dev/null +++ b/docs/QuotaRefObject.md @@ -0,0 +1,7 @@ +# Harbor2Client::QuotaRefObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/QuotaUpdateReq.md b/docs/QuotaUpdateReq.md new file mode 100644 index 0000000..5cd16d3 --- /dev/null +++ b/docs/QuotaUpdateReq.md @@ -0,0 +1,8 @@ +# Harbor2Client::QuotaUpdateReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hard** | [**ResourceList**](ResourceList.md) | The new hard limits for the quota | [optional] + + diff --git a/docs/Registry.md b/docs/Registry.md index 0d9f3b7..d01a982 100644 --- a/docs/Registry.md +++ b/docs/Registry.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **insecure** | **BOOLEAN** | Whether or not the certificate will be verified when Harbor tries to access the server. | [optional] **description** | **String** | Description of the registry. | [optional] **status** | **String** | Health status of the registry. | [optional] -**creation_time** | **String** | The create time of the policy. | [optional] -**update_time** | **String** | The update time of the policy. | [optional] +**creation_time** | **DateTime** | The create time of the policy. | [optional] +**update_time** | **DateTime** | The update time of the policy. | [optional] diff --git a/docs/RegistryApi.md b/docs/RegistryApi.md new file mode 100644 index 0000000..d3a3dce --- /dev/null +++ b/docs/RegistryApi.md @@ -0,0 +1,530 @@ +# Harbor2Client::RegistryApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_registry**](RegistryApi.md#create_registry) | **POST** /registries | Create a registry +[**delete_registry**](RegistryApi.md#delete_registry) | **DELETE** /registries/{id} | Delete the specific registry +[**get_registry**](RegistryApi.md#get_registry) | **GET** /registries/{id} | Get the specific registry +[**get_registry_info**](RegistryApi.md#get_registry_info) | **GET** /registries/{id}/info | Get the registry info +[**list_registries**](RegistryApi.md#list_registries) | **GET** /registries | List the registries +[**list_registry_provider_infos**](RegistryApi.md#list_registry_provider_infos) | **GET** /replication/adapterinfos | List all registered registry provider information +[**list_registry_provider_types**](RegistryApi.md#list_registry_provider_types) | **GET** /replication/adapters | List registry adapters +[**ping_registry**](RegistryApi.md#ping_registry) | **POST** /registries/ping | Check status of a registry +[**update_registry**](RegistryApi.md#update_registry) | **PUT** /registries/{id} | Update the registry + + +# **create_registry** +> create_registry(registry, opts) + +Create a registry + +Create a registry + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RegistryApi.new + +registry = Harbor2Client::Registry.new # Registry | The registry + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Create a registry + api_instance.create_registry(registry, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling RegistryApi->create_registry: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **registry** | [**Registry**](Registry.md)| The registry | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **delete_registry** +> delete_registry(id, opts) + +Delete the specific registry + +Delete the specific registry + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RegistryApi.new + +id = 789 # Integer | Registry ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Delete the specific registry + api_instance.delete_registry(id, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling RegistryApi->delete_registry: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Registry ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_registry** +> Registry get_registry(id, opts) + +Get the specific registry + +Get the specific registry + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RegistryApi.new + +id = 789 # Integer | Registry ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get the specific registry + result = api_instance.get_registry(id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RegistryApi->get_registry: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Registry ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**Registry**](Registry.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_registry_info** +> RegistryInfo get_registry_info(id, opts) + +Get the registry info + +Get the registry info + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RegistryApi.new + +id = 789 # Integer | Registry ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get the registry info + result = api_instance.get_registry_info(id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RegistryApi->get_registry_info: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Registry ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**RegistryInfo**](RegistryInfo.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_registries** +> Array<Registry> list_registries(opts) + +List the registries + +List the registries + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RegistryApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page + name: 'name_example' # String | Deprecated, use `q` instead. +} + +begin + #List the registries + result = api_instance.list_registries(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RegistryApi->list_registries: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + **name** | **String**| Deprecated, use `q` instead. | [optional] + +### Return type + +[**Array<Registry>**](Registry.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_registry_provider_infos** +> Hash<String, RegistryProviderInfo> list_registry_provider_infos(opts) + +List all registered registry provider information + +List all registered registry provider information + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RegistryApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #List all registered registry provider information + result = api_instance.list_registry_provider_infos(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RegistryApi->list_registry_provider_infos: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**Hash<String, RegistryProviderInfo>**](RegistryProviderInfo.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_registry_provider_types** +> Array<String> list_registry_provider_types(opts) + +List registry adapters + +List registry adapters + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RegistryApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #List registry adapters + result = api_instance.list_registry_provider_types(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RegistryApi->list_registry_provider_types: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +**Array<String>** + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **ping_registry** +> ping_registry(registry, opts) + +Check status of a registry + +Check status of a registry + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RegistryApi.new + +registry = Harbor2Client::RegistryPing.new # RegistryPing | The registry + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Check status of a registry + api_instance.ping_registry(registry, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling RegistryApi->ping_registry: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **registry** | [**RegistryPing**](RegistryPing.md)| The registry | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_registry** +> update_registry(id, registry, opts) + +Update the registry + +Update the registry + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RegistryApi.new + +id = 789 # Integer | The registry ID + +registry = Harbor2Client::RegistryUpdate.new # RegistryUpdate | The registry + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Update the registry + api_instance.update_registry(id, registry, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling RegistryApi->update_registry: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| The registry ID | + **registry** | [**RegistryUpdate**](RegistryUpdate.md)| The registry | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/RegistryEndpoint.md b/docs/RegistryEndpoint.md new file mode 100644 index 0000000..1eabd45 --- /dev/null +++ b/docs/RegistryEndpoint.md @@ -0,0 +1,9 @@ +# Harbor2Client::RegistryEndpoint + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **String** | The endpoint key | [optional] +**value** | **String** | The endpoint value | [optional] + + diff --git a/docs/RegistryInfo.md b/docs/RegistryInfo.md new file mode 100644 index 0000000..2e437e0 --- /dev/null +++ b/docs/RegistryInfo.md @@ -0,0 +1,11 @@ +# Harbor2Client::RegistryInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | The registry type | [optional] +**description** | **String** | The description | [optional] +**supported_resource_filters** | [**Array<FilterStyle>**](FilterStyle.md) | The filters that the registry supports | [optional] +**supported_triggers** | **Array<String>** | The triggers that the registry supports | [optional] + + diff --git a/docs/RegistryPing.md b/docs/RegistryPing.md new file mode 100644 index 0000000..3dcec9f --- /dev/null +++ b/docs/RegistryPing.md @@ -0,0 +1,14 @@ +# Harbor2Client::RegistryPing + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | The registry ID. | [optional] +**type** | **String** | Type of the registry, e.g. 'harbor'. | [optional] +**url** | **String** | The registry URL. | [optional] +**credential_type** | **String** | Credential type of the registry, e.g. 'basic'. | [optional] +**access_key** | **String** | The registry access key. | [optional] +**access_secret** | **String** | The registry access secret. | [optional] +**insecure** | **BOOLEAN** | Whether or not the certificate will be verified when Harbor tries to access the server. | [optional] + + diff --git a/docs/RegistryProviderCredentialPattern.md b/docs/RegistryProviderCredentialPattern.md new file mode 100644 index 0000000..5bc5df7 --- /dev/null +++ b/docs/RegistryProviderCredentialPattern.md @@ -0,0 +1,11 @@ +# Harbor2Client::RegistryProviderCredentialPattern + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_key_type** | **String** | The access key type | [optional] +**access_key_data** | **String** | The access key data | [optional] +**access_secret_type** | **String** | The access secret type | [optional] +**access_secret_data** | **String** | The access secret data | [optional] + + diff --git a/docs/RegistryProviderEndpointPattern.md b/docs/RegistryProviderEndpointPattern.md new file mode 100644 index 0000000..9d24246 --- /dev/null +++ b/docs/RegistryProviderEndpointPattern.md @@ -0,0 +1,9 @@ +# Harbor2Client::RegistryProviderEndpointPattern + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**endpoint_type** | **String** | The endpoint type | [optional] +**endpoints** | [**Array<RegistryEndpoint>**](RegistryEndpoint.md) | The endpoint list | [optional] + + diff --git a/docs/RegistryProviderInfo.md b/docs/RegistryProviderInfo.md new file mode 100644 index 0000000..ab1e580 --- /dev/null +++ b/docs/RegistryProviderInfo.md @@ -0,0 +1,9 @@ +# Harbor2Client::RegistryProviderInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**endpoint_pattern** | [**RegistryProviderEndpointPattern**](RegistryProviderEndpointPattern.md) | The endpoint pattern | [optional] +**credential_pattern** | [**RegistryProviderCredentialPattern**](RegistryProviderCredentialPattern.md) | The credential pattern | [optional] + + diff --git a/docs/RegistryUpdate.md b/docs/RegistryUpdate.md new file mode 100644 index 0000000..cde306b --- /dev/null +++ b/docs/RegistryUpdate.md @@ -0,0 +1,14 @@ +# Harbor2Client::RegistryUpdate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The registry name. | [optional] +**description** | **String** | Description of the registry. | [optional] +**url** | **String** | The registry URL. | [optional] +**credential_type** | **String** | Credential type of the registry, e.g. 'basic'. | [optional] +**access_key** | **String** | The registry access key. | [optional] +**access_secret** | **String** | The registry access secret. | [optional] +**insecure** | **BOOLEAN** | Whether or not the certificate will be verified when Harbor tries to access the server. | [optional] + + diff --git a/docs/ReplicationApi.md b/docs/ReplicationApi.md new file mode 100644 index 0000000..fcaf3fc --- /dev/null +++ b/docs/ReplicationApi.md @@ -0,0 +1,673 @@ +# Harbor2Client::ReplicationApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_replication_policy**](ReplicationApi.md#create_replication_policy) | **POST** /replication/policies | Create a replication policy +[**delete_replication_policy**](ReplicationApi.md#delete_replication_policy) | **DELETE** /replication/policies/{id} | Delete the specific replication policy +[**get_replication_execution**](ReplicationApi.md#get_replication_execution) | **GET** /replication/executions/{id} | Get the specific replication execution +[**get_replication_log**](ReplicationApi.md#get_replication_log) | **GET** /replication/executions/{id}/tasks/{task_id}/log | Get the log of the specific replication task +[**get_replication_policy**](ReplicationApi.md#get_replication_policy) | **GET** /replication/policies/{id} | Get the specific replication policy +[**list_replication_executions**](ReplicationApi.md#list_replication_executions) | **GET** /replication/executions | List replication executions +[**list_replication_policies**](ReplicationApi.md#list_replication_policies) | **GET** /replication/policies | List replication policies +[**list_replication_tasks**](ReplicationApi.md#list_replication_tasks) | **GET** /replication/executions/{id}/tasks | List replication tasks for a specific execution +[**start_replication**](ReplicationApi.md#start_replication) | **POST** /replication/executions | Start one replication execution +[**stop_replication**](ReplicationApi.md#stop_replication) | **PUT** /replication/executions/{id} | Stop the specific replication execution +[**update_replication_policy**](ReplicationApi.md#update_replication_policy) | **PUT** /replication/policies/{id} | Update the replication policy + + +# **create_replication_policy** +> create_replication_policy(policy, opts) + +Create a replication policy + +Create a replication policy + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ReplicationApi.new + +policy = Harbor2Client::ReplicationPolicy.new # ReplicationPolicy | The replication policy + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Create a replication policy + api_instance.create_replication_policy(policy, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ReplicationApi->create_replication_policy: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **policy** | [**ReplicationPolicy**](ReplicationPolicy.md)| The replication policy | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **delete_replication_policy** +> delete_replication_policy(id, opts) + +Delete the specific replication policy + +Delete the specific replication policy + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ReplicationApi.new + +id = 789 # Integer | Replication policy ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Delete the specific replication policy + api_instance.delete_replication_policy(id, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ReplicationApi->delete_replication_policy: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Replication policy ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_replication_execution** +> ReplicationExecution get_replication_execution(id, opts) + +Get the specific replication execution + +Get the replication execution specified by ID + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ReplicationApi.new + +id = 789 # Integer | The ID of the execution. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get the specific replication execution + result = api_instance.get_replication_execution(id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ReplicationApi->get_replication_execution: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| The ID of the execution. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**ReplicationExecution**](ReplicationExecution.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_replication_log** +> String get_replication_log(id, task_id, opts) + +Get the log of the specific replication task + +Get the log of the specific replication task + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ReplicationApi.new + +id = 789 # Integer | The ID of the execution that the tasks belongs to. + +task_id = 789 # Integer | The ID of the task. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get the log of the specific replication task + result = api_instance.get_replication_log(id, task_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ReplicationApi->get_replication_log: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| The ID of the execution that the tasks belongs to. | + **task_id** | **Integer**| The ID of the task. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +**String** + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/plain + + + +# **get_replication_policy** +> ReplicationPolicy get_replication_policy(id, opts) + +Get the specific replication policy + +Get the specific replication policy + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ReplicationApi.new + +id = 789 # Integer | Policy ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get the specific replication policy + result = api_instance.get_replication_policy(id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ReplicationApi->get_replication_policy: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Policy ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**ReplicationPolicy**](ReplicationPolicy.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_replication_executions** +> Array<ReplicationExecution> list_replication_executions(opts) + +List replication executions + +List replication executions + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ReplicationApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page + policy_id: 56, # Integer | The ID of the policy that the executions belong to. + status: 'status_example', # String | The execution status. + trigger: 'trigger_example' # String | The trigger mode. +} + +begin + #List replication executions + result = api_instance.list_replication_executions(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ReplicationApi->list_replication_executions: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + **policy_id** | **Integer**| The ID of the policy that the executions belong to. | [optional] + **status** | **String**| The execution status. | [optional] + **trigger** | **String**| The trigger mode. | [optional] + +### Return type + +[**Array<ReplicationExecution>**](ReplicationExecution.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_replication_policies** +> Array<ReplicationPolicy> list_replication_policies(opts) + +List replication policies + +List replication policies + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ReplicationApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page + name: 'name_example' # String | Deprecated, use \"query\" instead. The policy name. +} + +begin + #List replication policies + result = api_instance.list_replication_policies(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ReplicationApi->list_replication_policies: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + **name** | **String**| Deprecated, use \"query\" instead. The policy name. | [optional] + +### Return type + +[**Array<ReplicationPolicy>**](ReplicationPolicy.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_replication_tasks** +> Array<ReplicationTask> list_replication_tasks(id, opts) + +List replication tasks for a specific execution + +List replication tasks for a specific execution + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ReplicationApi.new + +id = 789 # Integer | The ID of the execution that the tasks belongs to. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page + status: 'status_example', # String | The task status. + resource_type: 'resource_type_example' # String | The resource type. +} + +begin + #List replication tasks for a specific execution + result = api_instance.list_replication_tasks(id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ReplicationApi->list_replication_tasks: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| The ID of the execution that the tasks belongs to. | + **x_request_id** | **String**| An unique ID for the request | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + **status** | **String**| The task status. | [optional] + **resource_type** | **String**| The resource type. | [optional] + +### Return type + +[**Array<ReplicationTask>**](ReplicationTask.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **start_replication** +> start_replication(execution, opts) + +Start one replication execution + +Start one replication execution according to the policy + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ReplicationApi.new + +execution = Harbor2Client::StartReplicationExecution.new # StartReplicationExecution | The ID of policy that the execution belongs to + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Start one replication execution + api_instance.start_replication(execution, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ReplicationApi->start_replication: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **execution** | [**StartReplicationExecution**](StartReplicationExecution.md)| The ID of policy that the execution belongs to | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **stop_replication** +> stop_replication(id, opts) + +Stop the specific replication execution + +Stop the replication execution specified by ID + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ReplicationApi.new + +id = 789 # Integer | The ID of the execution. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Stop the specific replication execution + api_instance.stop_replication(id, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ReplicationApi->stop_replication: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| The ID of the execution. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_replication_policy** +> update_replication_policy(id, policy, opts) + +Update the replication policy + +Update the replication policy + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ReplicationApi.new + +id = 789 # Integer | The policy ID + +policy = Harbor2Client::ReplicationPolicy.new # ReplicationPolicy | The replication policy + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Update the replication policy + api_instance.update_replication_policy(id, policy, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ReplicationApi->update_replication_policy: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| The policy ID | + **policy** | [**ReplicationPolicy**](ReplicationPolicy.md)| The replication policy | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/ReplicationExecution.md b/docs/ReplicationExecution.md new file mode 100644 index 0000000..7cd14e5 --- /dev/null +++ b/docs/ReplicationExecution.md @@ -0,0 +1,19 @@ +# Harbor2Client::ReplicationExecution + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | The ID of the execution | [optional] +**policy_id** | **Integer** | The ID if the policy that the execution belongs to | [optional] +**status** | **String** | The status of the execution | [optional] +**trigger** | **String** | The trigger mode | [optional] +**start_time** | **DateTime** | The start time | [optional] +**end_time** | **DateTime** | The end time | [optional] +**status_text** | **String** | The status text | [optional] +**total** | **Integer** | The total count of all executions | [optional] +**failed** | **Integer** | The count of failed executions | [optional] +**succeed** | **Integer** | The count of succeed executions | [optional] +**in_progress** | **Integer** | The count of in_progress executions | [optional] +**stopped** | **Integer** | The count of stopped executions | [optional] + + diff --git a/docs/ReplicationFilter.md b/docs/ReplicationFilter.md new file mode 100644 index 0000000..d82992b --- /dev/null +++ b/docs/ReplicationFilter.md @@ -0,0 +1,9 @@ +# Harbor2Client::ReplicationFilter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | The replication policy filter type. | [optional] +**value** | **Object** | The value of replication policy filter. | [optional] + + diff --git a/docs/ReplicationPolicy.md b/docs/ReplicationPolicy.md new file mode 100644 index 0000000..f5efc7b --- /dev/null +++ b/docs/ReplicationPolicy.md @@ -0,0 +1,22 @@ +# Harbor2Client::ReplicationPolicy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | The policy ID. | [optional] +**name** | **String** | The policy name. | [optional] +**description** | **String** | The description of the policy. | [optional] +**src_registry** | [**Registry**](Registry.md) | The source registry. | [optional] +**dest_registry** | [**Registry**](Registry.md) | The destination registry. | [optional] +**dest_namespace** | **String** | The destination namespace. | [optional] +**dest_namespace_replace_count** | **Integer** | Specify how many path components will be replaced by the provided destination namespace. The default value is -1 in which case the legacy mode will be applied. | [optional] +**trigger** | [**ReplicationTrigger**](ReplicationTrigger.md) | | [optional] +**filters** | [**Array<ReplicationFilter>**](ReplicationFilter.md) | The replication policy filter array. | [optional] +**replicate_deletion** | **BOOLEAN** | Whether to replicate the deletion operation. | [optional] +**deletion** | **BOOLEAN** | Deprecated, use \"replicate_deletion\" instead. Whether to replicate the deletion operation. | [optional] +**override** | **BOOLEAN** | Whether to override the resources on the destination registry. | [optional] +**enabled** | **BOOLEAN** | Whether the policy is enabled or not. | [optional] +**creation_time** | **DateTime** | The create time of the policy. | [optional] +**update_time** | **DateTime** | The update time of the policy. | [optional] + + diff --git a/docs/ReplicationTask.md b/docs/ReplicationTask.md new file mode 100644 index 0000000..065b6aa --- /dev/null +++ b/docs/ReplicationTask.md @@ -0,0 +1,17 @@ +# Harbor2Client::ReplicationTask + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | The ID of the task | [optional] +**execution_id** | **Integer** | The ID of the execution that the task belongs to | [optional] +**status** | **String** | The status of the task | [optional] +**job_id** | **String** | The ID of the underlying job that the task related to | [optional] +**operation** | **String** | The operation of the task | [optional] +**resource_type** | **String** | The type of the resource that the task operates | [optional] +**src_resource** | **String** | The source resource that the task operates | [optional] +**dst_resource** | **String** | The destination resource that the task operates | [optional] +**start_time** | **DateTime** | The start time of the task | [optional] +**end_time** | **DateTime** | The end time of the task | [optional] + + diff --git a/docs/ReplicationTrigger.md b/docs/ReplicationTrigger.md new file mode 100644 index 0000000..9bfed36 --- /dev/null +++ b/docs/ReplicationTrigger.md @@ -0,0 +1,9 @@ +# Harbor2Client::ReplicationTrigger + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | The replication policy trigger type. The valid values are manual, event_based and scheduled. | [optional] +**trigger_settings** | [**ReplicationTriggerSettings**](ReplicationTriggerSettings.md) | | [optional] + + diff --git a/docs/ReplicationTriggerSettings.md b/docs/ReplicationTriggerSettings.md new file mode 100644 index 0000000..ec88152 --- /dev/null +++ b/docs/ReplicationTriggerSettings.md @@ -0,0 +1,8 @@ +# Harbor2Client::ReplicationTriggerSettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cron** | **String** | The cron string for scheduled trigger | [optional] + + diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md index decd3ac..45eeff1 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**delete_repository**](RepositoryApi.md#delete_repository) | **DELETE** /projects/{project_name}/repositories/{repository_name} | Delete repository [**get_repository**](RepositoryApi.md#get_repository) | **GET** /projects/{project_name}/repositories/{repository_name} | Get repository +[**list_all_repositories**](RepositoryApi.md#list_all_repositories) | **GET** /repositories | List all authorized repositories [**list_repositories**](RepositoryApi.md#list_repositories) | **GET** /projects/{project_name}/repositories | List repositories [**update_repository**](RepositoryApi.md#update_repository) | **PUT** /projects/{project_name}/repositories/{repository_name} | Update repository @@ -129,6 +130,68 @@ Name | Type | Description | Notes +# **list_all_repositories** +> Array<Repository> list_all_repositories(opts) + +List all authorized repositories + +List all authorized repositories + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RepositoryApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page +} + +begin + #List all authorized repositories + result = api_instance.list_all_repositories(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RepositoryApi->list_all_repositories: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + +### Return type + +[**Array<Repository>**](Repository.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + # **list_repositories** > Array<Repository> list_repositories(project_name, opts) @@ -153,7 +216,8 @@ project_name = 'project_name_example' # String | The name of the project opts = { x_request_id: 'x_request_id_example' # String | An unique ID for the request - q: 'q_example' # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" page: 1, # Integer | The page number page_size: 10, # Integer | The size of per page } @@ -174,6 +238,7 @@ Name | Type | Description | Notes **project_name** | **String**| The name of the project | **x_request_id** | **String**| An unique ID for the request | [optional] **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] **page** | **Integer**| The page number | [optional] [default to 1] **page_size** | **Integer**| The size of per page | [optional] [default to 10] diff --git a/docs/RetentionApi.md b/docs/RetentionApi.md new file mode 100644 index 0000000..43f3004 --- /dev/null +++ b/docs/RetentionApi.md @@ -0,0 +1,609 @@ +# Harbor2Client::RetentionApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_retention**](RetentionApi.md#create_retention) | **POST** /retentions | Create Retention Policy +[**delete_retention**](RetentionApi.md#delete_retention) | **DELETE** /retentions/{id} | Delete Retention Policy +[**get_rentenition_metadata**](RetentionApi.md#get_rentenition_metadata) | **GET** /retentions/metadatas | Get Retention Metadatas +[**get_retention**](RetentionApi.md#get_retention) | **GET** /retentions/{id} | Get Retention Policy +[**get_retention_task_log**](RetentionApi.md#get_retention_task_log) | **GET** /retentions/{id}/executions/{eid}/tasks/{tid} | Get Retention job task log +[**list_retention_executions**](RetentionApi.md#list_retention_executions) | **GET** /retentions/{id}/executions | Get Retention executions +[**list_retention_tasks**](RetentionApi.md#list_retention_tasks) | **GET** /retentions/{id}/executions/{eid}/tasks | Get Retention tasks +[**operate_retention_execution**](RetentionApi.md#operate_retention_execution) | **PATCH** /retentions/{id}/executions/{eid} | Stop a Retention execution +[**trigger_retention_execution**](RetentionApi.md#trigger_retention_execution) | **POST** /retentions/{id}/executions | Trigger a Retention Execution +[**update_retention**](RetentionApi.md#update_retention) | **PUT** /retentions/{id} | Update Retention Policy + + +# **create_retention** +> create_retention(policy, opts) + +Create Retention Policy + +Create Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already binded. This method should only be called when no retention policy binded to project yet. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RetentionApi.new + +policy = Harbor2Client::RetentionPolicy.new # RetentionPolicy | Create Retention Policy successfully. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Create Retention Policy + api_instance.create_retention(policy, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling RetentionApi->create_retention: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **policy** | [**RetentionPolicy**](RetentionPolicy.md)| Create Retention Policy successfully. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **delete_retention** +> delete_retention(id, opts) + +Delete Retention Policy + +Delete Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already binded. This method should only be called when retention policy has already binded to project. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RetentionApi.new + +id = 789 # Integer | Retention ID. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Delete Retention Policy + api_instance.delete_retention(id, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling RetentionApi->delete_retention: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Retention ID. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_rentenition_metadata** +> RetentionMetadata get_rentenition_metadata(opts) + +Get Retention Metadatas + +Get Retention Metadatas. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RetentionApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get Retention Metadatas + result = api_instance.get_rentenition_metadata(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RetentionApi->get_rentenition_metadata: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**RetentionMetadata**](RetentionMetadata.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_retention** +> RetentionPolicy get_retention(id, opts) + +Get Retention Policy + +Get Retention Policy. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RetentionApi.new + +id = 789 # Integer | Retention ID. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get Retention Policy + result = api_instance.get_retention(id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RetentionApi->get_retention: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Retention ID. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**RetentionPolicy**](RetentionPolicy.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_retention_task_log** +> String get_retention_task_log(id, eid, tid, opts) + +Get Retention job task log + +Get Retention job task log, tags ratain or deletion detail will be shown in a table. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RetentionApi.new + +id = 789 # Integer | Retention ID. + +eid = 789 # Integer | Retention execution ID. + +tid = 789 # Integer | Retention execution ID. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get Retention job task log + result = api_instance.get_retention_task_log(id, eid, tid, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RetentionApi->get_retention_task_log: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Retention ID. | + **eid** | **Integer**| Retention execution ID. | + **tid** | **Integer**| Retention execution ID. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +**String** + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/plain + + + +# **list_retention_executions** +> Array<RetentionExecution> list_retention_executions(id, opts) + +Get Retention executions + +Get Retention executions, execution status may be delayed before job service schedule it up. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RetentionApi.new + +id = 789 # Integer | Retention ID. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + page: 789, # Integer | The page number. + page_size: 789 # Integer | The size of per page. +} + +begin + #Get Retention executions + result = api_instance.list_retention_executions(id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RetentionApi->list_retention_executions: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Retention ID. | + **x_request_id** | **String**| An unique ID for the request | [optional] + **page** | **Integer**| The page number. | [optional] + **page_size** | **Integer**| The size of per page. | [optional] + +### Return type + +[**Array<RetentionExecution>**](RetentionExecution.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_retention_tasks** +> Array<RetentionExecutionTask> list_retention_tasks(id, eid, opts) + +Get Retention tasks + +Get Retention tasks, each repository as a task. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RetentionApi.new + +id = 789 # Integer | Retention ID. + +eid = 789 # Integer | Retention execution ID. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + page: 789, # Integer | The page number. + page_size: 789 # Integer | The size of per page. +} + +begin + #Get Retention tasks + result = api_instance.list_retention_tasks(id, eid, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RetentionApi->list_retention_tasks: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Retention ID. | + **eid** | **Integer**| Retention execution ID. | + **x_request_id** | **String**| An unique ID for the request | [optional] + **page** | **Integer**| The page number. | [optional] + **page_size** | **Integer**| The size of per page. | [optional] + +### Return type + +[**Array<RetentionExecutionTask>**](RetentionExecutionTask.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **operate_retention_execution** +> operate_retention_execution(id, eid, body, opts) + +Stop a Retention execution + +Stop a Retention execution, only support \"stop\" action now. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RetentionApi.new + +id = 789 # Integer | Retention ID. + +eid = 789 # Integer | Retention execution ID. + +body = Harbor2Client::Body1.new # Body1 | The action, only support \"stop\" now. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Stop a Retention execution + api_instance.operate_retention_execution(id, eid, body, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling RetentionApi->operate_retention_execution: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Retention ID. | + **eid** | **Integer**| Retention execution ID. | + **body** | [**Body1**](Body1.md)| The action, only support \"stop\" now. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **trigger_retention_execution** +> trigger_retention_execution(id, body, opts) + +Trigger a Retention Execution + +Trigger a Retention Execution, if dry_run is True, nothing would be deleted actually. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RetentionApi.new + +id = 789 # Integer | Retention ID. + +body = Harbor2Client::Body.new # Body | + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Trigger a Retention Execution + api_instance.trigger_retention_execution(id, body, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling RetentionApi->trigger_retention_execution: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Retention ID. | + **body** | [**Body**](Body.md)| | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/plain + + + +# **update_retention** +> update_retention(id, policy, opts) + +Update Retention Policy + +Update Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already binded. This method should only be called when retention policy has already binded to project. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RetentionApi.new + +id = 789 # Integer | Retention ID. + +policy = Harbor2Client::RetentionPolicy.new # RetentionPolicy | + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Update Retention Policy + api_instance.update_retention(id, policy, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling RetentionApi->update_retention: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| Retention ID. | + **policy** | [**RetentionPolicy**](RetentionPolicy.md)| | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/RetentionExecution.md b/docs/RetentionExecution.md new file mode 100644 index 0000000..0d22415 --- /dev/null +++ b/docs/RetentionExecution.md @@ -0,0 +1,14 @@ +# Harbor2Client::RetentionExecution + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**policy_id** | **Integer** | | [optional] +**start_time** | **String** | | [optional] +**end_time** | **String** | | [optional] +**status** | **String** | | [optional] +**trigger** | **String** | | [optional] +**dry_run** | **BOOLEAN** | | [optional] + + diff --git a/docs/RetentionExecutionTask.md b/docs/RetentionExecutionTask.md new file mode 100644 index 0000000..cf3f1b0 --- /dev/null +++ b/docs/RetentionExecutionTask.md @@ -0,0 +1,18 @@ +# Harbor2Client::RetentionExecutionTask + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**execution_id** | **Integer** | | [optional] +**repository** | **String** | | [optional] +**job_id** | **String** | | [optional] +**status** | **String** | | [optional] +**status_code** | **Integer** | | [optional] +**status_revision** | **Integer** | | [optional] +**start_time** | **String** | | [optional] +**end_time** | **String** | | [optional] +**total** | **Integer** | | [optional] +**retained** | **Integer** | | [optional] + + diff --git a/docs/RetentionMetadata.md b/docs/RetentionMetadata.md new file mode 100644 index 0000000..ca5f923 --- /dev/null +++ b/docs/RetentionMetadata.md @@ -0,0 +1,10 @@ +# Harbor2Client::RetentionMetadata + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**templates** | [**Array<RetentionRuleMetadata>**](RetentionRuleMetadata.md) | templates | [optional] +**scope_selectors** | [**Array<RetentionSelectorMetadata>**](RetentionSelectorMetadata.md) | supported scope selectors | [optional] +**tag_selectors** | [**Array<RetentionSelectorMetadata>**](RetentionSelectorMetadata.md) | supported tag selectors | [optional] + + diff --git a/docs/RetentionPolicy.md b/docs/RetentionPolicy.md new file mode 100644 index 0000000..f0dbff9 --- /dev/null +++ b/docs/RetentionPolicy.md @@ -0,0 +1,12 @@ +# Harbor2Client::RetentionPolicy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**algorithm** | **String** | | [optional] +**rules** | [**Array<RetentionRule>**](RetentionRule.md) | | [optional] +**trigger** | [**RetentionRuleTrigger**](RetentionRuleTrigger.md) | | [optional] +**scope** | [**RetentionPolicyScope**](RetentionPolicyScope.md) | | [optional] + + diff --git a/docs/RetentionPolicyScope.md b/docs/RetentionPolicyScope.md new file mode 100644 index 0000000..6998967 --- /dev/null +++ b/docs/RetentionPolicyScope.md @@ -0,0 +1,9 @@ +# Harbor2Client::RetentionPolicyScope + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**level** | **String** | | [optional] +**ref** | **Integer** | | [optional] + + diff --git a/docs/RetentionRule.md b/docs/RetentionRule.md new file mode 100644 index 0000000..d57d277 --- /dev/null +++ b/docs/RetentionRule.md @@ -0,0 +1,15 @@ +# Harbor2Client::RetentionRule + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**priority** | **Integer** | | [optional] +**disabled** | **BOOLEAN** | | [optional] +**action** | **String** | | [optional] +**template** | **String** | | [optional] +**params** | **Hash<String, Object>** | | [optional] +**tag_selectors** | [**Array<RetentionSelector>**](RetentionSelector.md) | | [optional] +**scope_selectors** | **Hash<String, Array<RetentionSelector>>** | | [optional] + + diff --git a/docs/RetentionRuleMetadata.md b/docs/RetentionRuleMetadata.md new file mode 100644 index 0000000..565737b --- /dev/null +++ b/docs/RetentionRuleMetadata.md @@ -0,0 +1,11 @@ +# Harbor2Client::RetentionRuleMetadata + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rule_template** | **String** | rule id | [optional] +**display_text** | **String** | rule display text | [optional] +**action** | **String** | rule action | [optional] +**params** | [**Array<RetentionRuleParamMetadata>**](RetentionRuleParamMetadata.md) | rule params | [optional] + + diff --git a/docs/RetentionRuleParamMetadata.md b/docs/RetentionRuleParamMetadata.md new file mode 100644 index 0000000..08883fd --- /dev/null +++ b/docs/RetentionRuleParamMetadata.md @@ -0,0 +1,10 @@ +# Harbor2Client::RetentionRuleParamMetadata + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | | [optional] +**unit** | **String** | | [optional] +**required** | **BOOLEAN** | | [optional] + + diff --git a/docs/RetentionRuleTrigger.md b/docs/RetentionRuleTrigger.md new file mode 100644 index 0000000..529e882 --- /dev/null +++ b/docs/RetentionRuleTrigger.md @@ -0,0 +1,10 @@ +# Harbor2Client::RetentionRuleTrigger + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] +**settings** | **Object** | | [optional] +**references** | **Object** | | [optional] + + diff --git a/docs/RetentionSelector.md b/docs/RetentionSelector.md new file mode 100644 index 0000000..31c7bd6 --- /dev/null +++ b/docs/RetentionSelector.md @@ -0,0 +1,11 @@ +# Harbor2Client::RetentionSelector + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] +**decoration** | **String** | | [optional] +**pattern** | **String** | | [optional] +**extras** | **String** | | [optional] + + diff --git a/docs/RetentionSelectorMetadata.md b/docs/RetentionSelectorMetadata.md new file mode 100644 index 0000000..506026d --- /dev/null +++ b/docs/RetentionSelectorMetadata.md @@ -0,0 +1,10 @@ +# Harbor2Client::RetentionSelectorMetadata + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**display_text** | **String** | | [optional] +**kind** | **String** | | [optional] +**decorations** | **Array<String>** | | [optional] + + diff --git a/docs/Robot.md b/docs/Robot.md new file mode 100644 index 0000000..99d38a2 --- /dev/null +++ b/docs/Robot.md @@ -0,0 +1,19 @@ +# Harbor2Client::Robot + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | The ID of the robot | [optional] +**name** | **String** | The name of the tag | [optional] +**description** | **String** | The description of the robot | [optional] +**secret** | **String** | The secret of the robot | [optional] +**level** | **String** | The level of the robot, project or system | [optional] +**duration** | **Integer** | The duration of the robot in days | [optional] +**editable** | **BOOLEAN** | The editable status of the robot | [optional] +**disable** | **BOOLEAN** | The disable status of the robot | [optional] +**expires_at** | **Integer** | The expiration data of the robot | [optional] +**permissions** | [**Array<RobotPermission>**](RobotPermission.md) | | [optional] +**creation_time** | **DateTime** | The creation time of the robot. | [optional] +**update_time** | **DateTime** | The update time of the robot. | [optional] + + diff --git a/docs/RobotApi.md b/docs/RobotApi.md new file mode 100644 index 0000000..62d1d11 --- /dev/null +++ b/docs/RobotApi.md @@ -0,0 +1,365 @@ +# Harbor2Client::RobotApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_robot**](RobotApi.md#create_robot) | **POST** /robots | Create a robot account +[**delete_robot**](RobotApi.md#delete_robot) | **DELETE** /robots/{robot_id} | Delete a robot account +[**get_robot_by_id**](RobotApi.md#get_robot_by_id) | **GET** /robots/{robot_id} | Get a robot account +[**list_robot**](RobotApi.md#list_robot) | **GET** /robots | Get robot account +[**refresh_sec**](RobotApi.md#refresh_sec) | **PATCH** /robots/{robot_id} | Refresh the robot secret +[**update_robot**](RobotApi.md#update_robot) | **PUT** /robots/{robot_id} | Update a robot account + + +# **create_robot** +> RobotCreated create_robot(robot, opts) + +Create a robot account + +Create a robot account + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RobotApi.new + +robot = Harbor2Client::RobotCreate.new # RobotCreate | The JSON object of a robot account. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Create a robot account + result = api_instance.create_robot(robot, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RobotApi->create_robot: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **robot** | [**RobotCreate**](RobotCreate.md)| The JSON object of a robot account. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**RobotCreated**](RobotCreated.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **delete_robot** +> delete_robot(robot_id, , opts) + +Delete a robot account + +This endpoint deletes specific robot account information by robot ID. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RobotApi.new + +robot_id = 56 # Integer | Robot ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Delete a robot account + api_instance.delete_robot(robot_id, , opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling RobotApi->delete_robot: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **robot_id** | **Integer**| Robot ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_robot_by_id** +> Robot get_robot_by_id(robot_id, , opts) + +Get a robot account + +This endpoint returns specific robot account information by robot ID. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RobotApi.new + +robot_id = 56 # Integer | Robot ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get a robot account + result = api_instance.get_robot_by_id(robot_id, , opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RobotApi->get_robot_by_id: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **robot_id** | **Integer**| Robot ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**Robot**](Robot.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_robot** +> Array<Robot> list_robot(opts) + +Get robot account + +List the robot accounts with the specified level and project. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RobotApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page +} + +begin + #Get robot account + result = api_instance.list_robot(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RobotApi->list_robot: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + +### Return type + +[**Array<Robot>**](Robot.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **refresh_sec** +> RobotSec refresh_sec(robot_id, robot_sec, opts) + +Refresh the robot secret + +Refresh the robot secret + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RobotApi.new + +robot_id = 56 # Integer | Robot ID + +robot_sec = Harbor2Client::RobotSec.new # RobotSec | The JSON object of a robot account. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Refresh the robot secret + result = api_instance.refresh_sec(robot_id, robot_sec, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling RobotApi->refresh_sec: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **robot_id** | **Integer**| Robot ID | + **robot_sec** | [**RobotSec**](RobotSec.md)| The JSON object of a robot account. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**RobotSec**](RobotSec.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_robot** +> update_robot(robot_id, robot, opts) + +Update a robot account + +This endpoint updates specific robot account information by robot ID. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::RobotApi.new + +robot_id = 56 # Integer | Robot ID + +robot = Harbor2Client::Robot.new # Robot | The JSON object of a robot account. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Update a robot account + api_instance.update_robot(robot_id, robot, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling RobotApi->update_robot: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **robot_id** | **Integer**| Robot ID | + **robot** | [**Robot**](Robot.md)| The JSON object of a robot account. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/RobotCreate.md b/docs/RobotCreate.md new file mode 100644 index 0000000..c5f32d9 --- /dev/null +++ b/docs/RobotCreate.md @@ -0,0 +1,14 @@ +# Harbor2Client::RobotCreate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The name of the tag | [optional] +**description** | **String** | The description of the robot | [optional] +**secret** | **String** | The secret of the robot | [optional] +**level** | **String** | The level of the robot, project or system | [optional] +**disable** | **BOOLEAN** | The disable status of the robot | [optional] +**duration** | **Integer** | The duration of the robot in days | [optional] +**permissions** | [**Array<RobotPermission>**](RobotPermission.md) | | [optional] + + diff --git a/docs/RobotCreateV1.md b/docs/RobotCreateV1.md new file mode 100644 index 0000000..afefeaf --- /dev/null +++ b/docs/RobotCreateV1.md @@ -0,0 +1,11 @@ +# Harbor2Client::RobotCreateV1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The name of robot account | [optional] +**description** | **String** | The description of robot account | [optional] +**expires_at** | **Integer** | The expiration time on or after which the JWT MUST NOT be accepted for processing. | [optional] +**access** | [**Array<Access>**](Access.md) | The permission of robot account | [optional] + + diff --git a/docs/RobotCreated.md b/docs/RobotCreated.md new file mode 100644 index 0000000..5b567cf --- /dev/null +++ b/docs/RobotCreated.md @@ -0,0 +1,12 @@ +# Harbor2Client::RobotCreated + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | The ID of the robot | [optional] +**name** | **String** | The name of the tag | [optional] +**secret** | **String** | The secret of the robot | [optional] +**creation_time** | **DateTime** | The creation time of the robot. | [optional] +**expires_at** | **Integer** | The expiration data of the robot | [optional] + + diff --git a/docs/RobotPermission.md b/docs/RobotPermission.md new file mode 100644 index 0000000..989ff51 --- /dev/null +++ b/docs/RobotPermission.md @@ -0,0 +1,10 @@ +# Harbor2Client::RobotPermission + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | The kind of the permission | [optional] +**namespace** | **String** | The namespace of the permission | [optional] +**access** | [**Array<Access>**](Access.md) | | [optional] + + diff --git a/docs/RobotSec.md b/docs/RobotSec.md new file mode 100644 index 0000000..6ca68bf --- /dev/null +++ b/docs/RobotSec.md @@ -0,0 +1,8 @@ +# Harbor2Client::RobotSec + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**secret** | **String** | The secret of the robot | [optional] + + diff --git a/docs/Robotv1Api.md b/docs/Robotv1Api.md new file mode 100644 index 0000000..353f199 --- /dev/null +++ b/docs/Robotv1Api.md @@ -0,0 +1,329 @@ +# Harbor2Client::Robotv1Api + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_robot_v1**](Robotv1Api.md#create_robot_v1) | **POST** /projects/{project_name_or_id}/robots | Create a robot account +[**delete_robot_v1**](Robotv1Api.md#delete_robot_v1) | **DELETE** /projects/{project_name_or_id}/robots/{robot_id} | Delete a robot account +[**get_robot_by_idv1**](Robotv1Api.md#get_robot_by_idv1) | **GET** /projects/{project_name_or_id}/robots/{robot_id} | Get a robot account +[**list_robot_v1**](Robotv1Api.md#list_robot_v1) | **GET** /projects/{project_name_or_id}/robots | Get all robot accounts of specified project +[**update_robot_v1**](Robotv1Api.md#update_robot_v1) | **PUT** /projects/{project_name_or_id}/robots/{robot_id} | Update status of robot account. + + +# **create_robot_v1** +> RobotCreated create_robot_v1(project_name_or_idrobot, opts) + +Create a robot account + +Create a robot account + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::Robotv1Api.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +robot = Harbor2Client::RobotCreateV1.new # RobotCreateV1 | The JSON object of a robot account. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Create a robot account + result = api_instance.create_robot_v1(project_name_or_idrobot, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling Robotv1Api->create_robot_v1: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **robot** | [**RobotCreateV1**](RobotCreateV1.md)| The JSON object of a robot account. | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +[**RobotCreated**](RobotCreated.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **delete_robot_v1** +> delete_robot_v1(project_name_or_idrobot_id, , opts) + +Delete a robot account + +This endpoint deletes specific robot account information by robot ID. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::Robotv1Api.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +robot_id = 56 # Integer | Robot ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Delete a robot account + api_instance.delete_robot_v1(project_name_or_idrobot_id, , opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling Robotv1Api->delete_robot_v1: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **robot_id** | **Integer**| Robot ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_robot_by_idv1** +> Robot get_robot_by_idv1(project_name_or_idrobot_id, , opts) + +Get a robot account + +This endpoint returns specific robot account information by robot ID. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::Robotv1Api.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +robot_id = 56 # Integer | Robot ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Get a robot account + result = api_instance.get_robot_by_idv1(project_name_or_idrobot_id, , opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling Robotv1Api->get_robot_by_idv1: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **robot_id** | **Integer**| Robot ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +[**Robot**](Robot.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_robot_v1** +> Array<Robot> list_robot_v1(project_name_or_id, opts) + +Get all robot accounts of specified project + +Get all robot accounts of specified project + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::Robotv1Api.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" +} + +begin + #Get all robot accounts of specified project + result = api_instance.list_robot_v1(project_name_or_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling Robotv1Api->list_robot_v1: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + +### Return type + +[**Array<Robot>**](Robot.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_robot_v1** +> update_robot_v1(project_name_or_idrobot_id, robot, opts) + +Update status of robot account. + +Used to disable/enable a specified robot account. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::Robotv1Api.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +robot_id = 56 # Integer | Robot ID + +robot = Harbor2Client::Robot.new # Robot | The JSON object of a robot account. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Update status of robot account. + api_instance.update_robot_v1(project_name_or_idrobot_id, robot, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling Robotv1Api->update_robot_v1: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **robot_id** | **Integer**| Robot ID | + **robot** | [**Robot**](Robot.md)| The JSON object of a robot account. | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/RoleRequest.md b/docs/RoleRequest.md new file mode 100644 index 0000000..0682fb4 --- /dev/null +++ b/docs/RoleRequest.md @@ -0,0 +1,8 @@ +# Harbor2Client::RoleRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_id** | **Integer** | The role id 1 for projectAdmin, 2 for developer, 3 for guest, 4 for maintainer | [optional] + + diff --git a/docs/ScanAllApi.md b/docs/ScanAllApi.md new file mode 100644 index 0000000..b9c6b55 --- /dev/null +++ b/docs/ScanAllApi.md @@ -0,0 +1,287 @@ +# Harbor2Client::ScanAllApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_scan_all_schedule**](ScanAllApi.md#create_scan_all_schedule) | **POST** /system/scanAll/schedule | Create a schedule or a manual trigger for the scan all job. +[**get_latest_scan_all_metrics**](ScanAllApi.md#get_latest_scan_all_metrics) | **GET** /scans/all/metrics | Get the metrics of the latest scan all process +[**get_latest_scheduled_scan_all_metrics**](ScanAllApi.md#get_latest_scheduled_scan_all_metrics) | **GET** /scans/schedule/metrics | Get the metrics of the latest scheduled scan all process +[**get_scan_all_schedule**](ScanAllApi.md#get_scan_all_schedule) | **GET** /system/scanAll/schedule | Get scan all's schedule. +[**update_scan_all_schedule**](ScanAllApi.md#update_scan_all_schedule) | **PUT** /system/scanAll/schedule | Update scan all's schedule. + + +# **create_scan_all_schedule** +> create_scan_all_schedule(schedule, opts) + +Create a schedule or a manual trigger for the scan all job. + +This endpoint is for creating a schedule or a manual trigger for the scan all job, which scans all of images in Harbor. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ScanAllApi.new + +schedule = Harbor2Client::Schedule.new # Schedule | Create a schedule or a manual trigger for the scan all job. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Create a schedule or a manual trigger for the scan all job. + api_instance.create_scan_all_schedule(schedule, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ScanAllApi->create_scan_all_schedule: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **schedule** | [**Schedule**](Schedule.md)| Create a schedule or a manual trigger for the scan all job. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_latest_scan_all_metrics** +> Stats get_latest_scan_all_metrics(opts) + +Get the metrics of the latest scan all process + +Get the metrics of the latest scan all process + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ScanAllApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get the metrics of the latest scan all process + result = api_instance.get_latest_scan_all_metrics(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ScanAllApi->get_latest_scan_all_metrics: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**Stats**](Stats.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_latest_scheduled_scan_all_metrics** +> Stats get_latest_scheduled_scan_all_metrics(opts) + +Get the metrics of the latest scheduled scan all process + +Get the metrics of the latest scheduled scan all process + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ScanAllApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get the metrics of the latest scheduled scan all process + result = api_instance.get_latest_scheduled_scan_all_metrics(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ScanAllApi->get_latest_scheduled_scan_all_metrics: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**Stats**](Stats.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_scan_all_schedule** +> Schedule get_scan_all_schedule(opts) + +Get scan all's schedule. + +This endpoint is for getting a schedule for the scan all job, which scans all of images in Harbor. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ScanAllApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get scan all's schedule. + result = api_instance.get_scan_all_schedule(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ScanAllApi->get_scan_all_schedule: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**Schedule**](Schedule.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_scan_all_schedule** +> update_scan_all_schedule(schedule, opts) + +Update scan all's schedule. + +This endpoint is for updating the schedule of scan all job, which scans all of images in Harbor. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ScanAllApi.new + +schedule = Harbor2Client::Schedule.new # Schedule | Updates the schedule of scan all job, which scans all of images in Harbor. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Update scan all's schedule. + api_instance.update_scan_all_schedule(schedule, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ScanAllApi->update_scan_all_schedule: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **schedule** | [**Schedule**](Schedule.md)| Updates the schedule of scan all job, which scans all of images in Harbor. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/Scanner.md b/docs/Scanner.md new file mode 100644 index 0000000..5396df3 --- /dev/null +++ b/docs/Scanner.md @@ -0,0 +1,10 @@ +# Harbor2Client::Scanner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the scanner | [optional] +**vendor** | **String** | Name of the scanner provider | [optional] +**version** | **String** | Version of the scanner adapter | [optional] + + diff --git a/docs/ScannerAdapterMetadata.md b/docs/ScannerAdapterMetadata.md new file mode 100644 index 0000000..20e2021 --- /dev/null +++ b/docs/ScannerAdapterMetadata.md @@ -0,0 +1,10 @@ +# Harbor2Client::ScannerAdapterMetadata + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scanner** | [**Scanner**](Scanner.md) | | [optional] +**capabilities** | [**Array<ScannerCapability>**](ScannerCapability.md) | | [optional] +**properties** | **Hash<String, String>** | | [optional] + + diff --git a/docs/ScannerApi.md b/docs/ScannerApi.md new file mode 100644 index 0000000..1c4f903 --- /dev/null +++ b/docs/ScannerApi.md @@ -0,0 +1,479 @@ +# Harbor2Client::ScannerApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_scanner**](ScannerApi.md#create_scanner) | **POST** /scanners | Create a scanner registration +[**delete_scanner**](ScannerApi.md#delete_scanner) | **DELETE** /scanners/{registration_id} | Delete a scanner registration +[**get_scanner**](ScannerApi.md#get_scanner) | **GET** /scanners/{registration_id} | Get a scanner registration details +[**get_scanner_metadata**](ScannerApi.md#get_scanner_metadata) | **GET** /scanners/{registration_id}/metadata | Get the metadata of the specified scanner registration +[**list_scanners**](ScannerApi.md#list_scanners) | **GET** /scanners | List scanner registrations +[**ping_scanner**](ScannerApi.md#ping_scanner) | **POST** /scanners/ping | Tests scanner registration settings +[**set_scanner_as_default**](ScannerApi.md#set_scanner_as_default) | **PATCH** /scanners/{registration_id} | Set system default scanner registration +[**update_scanner**](ScannerApi.md#update_scanner) | **PUT** /scanners/{registration_id} | Update a scanner registration + + +# **create_scanner** +> create_scanner(registration, opts) + +Create a scanner registration + +Creats a new scanner registration with the given data. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ScannerApi.new + +registration = Harbor2Client::ScannerRegistrationReq.new # ScannerRegistrationReq | A scanner registration to be created. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Create a scanner registration + api_instance.create_scanner(registration, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ScannerApi->create_scanner: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **registration** | [**ScannerRegistrationReq**](ScannerRegistrationReq.md)| A scanner registration to be created. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **delete_scanner** +> ScannerRegistration delete_scanner(registration_id, opts) + +Delete a scanner registration + +Deletes the specified scanner registration. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ScannerApi.new + +registration_id = 'registration_id_example' # String | The scanner registration identifier. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Delete a scanner registration + result = api_instance.delete_scanner(registration_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ScannerApi->delete_scanner: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **registration_id** | **String**| The scanner registration identifier. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**ScannerRegistration**](ScannerRegistration.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_scanner** +> ScannerRegistration get_scanner(registration_id, opts) + +Get a scanner registration details + +Retruns the details of the specified scanner registration. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ScannerApi.new + +registration_id = 'registration_id_example' # String | The scanner registration identifer. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get a scanner registration details + result = api_instance.get_scanner(registration_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ScannerApi->get_scanner: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **registration_id** | **String**| The scanner registration identifer. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**ScannerRegistration**](ScannerRegistration.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_scanner_metadata** +> ScannerAdapterMetadata get_scanner_metadata(registration_id, opts) + +Get the metadata of the specified scanner registration + +Get the metadata of the specified scanner registration, including the capabilities and customized properties. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ScannerApi.new + +registration_id = 'registration_id_example' # String | The scanner registration identifier. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get the metadata of the specified scanner registration + result = api_instance.get_scanner_metadata(registration_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ScannerApi->get_scanner_metadata: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **registration_id** | **String**| The scanner registration identifier. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**ScannerAdapterMetadata**](ScannerAdapterMetadata.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_scanners** +> Array<ScannerRegistration> list_scanners(opts) + +List scanner registrations + +Returns a list of currently configured scanner registrations. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ScannerApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page +} + +begin + #List scanner registrations + result = api_instance.list_scanners(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling ScannerApi->list_scanners: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + +### Return type + +[**Array<ScannerRegistration>**](ScannerRegistration.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **ping_scanner** +> ping_scanner(settings, opts) + +Tests scanner registration settings + +Pings scanner adapter to test endpoint URL and authorization settings. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ScannerApi.new + +settings = Harbor2Client::ScannerRegistrationSettings.new # ScannerRegistrationSettings | A scanner registration settings to be tested. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Tests scanner registration settings + api_instance.ping_scanner(settings, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ScannerApi->ping_scanner: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settings** | [**ScannerRegistrationSettings**](ScannerRegistrationSettings.md)| A scanner registration settings to be tested. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **set_scanner_as_default** +> set_scanner_as_default(registration_id, payload, opts) + +Set system default scanner registration + +Set the specified scanner registration as the system default one. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ScannerApi.new + +registration_id = 'registration_id_example' # String | The scanner registration identifier. + +payload = Harbor2Client::IsDefault.new # IsDefault | + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Set system default scanner registration + api_instance.set_scanner_as_default(registration_id, payload, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ScannerApi->set_scanner_as_default: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **registration_id** | **String**| The scanner registration identifier. | + **payload** | [**IsDefault**](IsDefault.md)| | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_scanner** +> update_scanner(registration_id, registration, opts) + +Update a scanner registration + +Updates the specified scanner registration. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::ScannerApi.new + +registration_id = 'registration_id_example' # String | The scanner registration identifier. + +registration = Harbor2Client::ScannerRegistrationReq.new # ScannerRegistrationReq | A scanner registraiton to be updated. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Update a scanner registration + api_instance.update_scanner(registration_id, registration, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling ScannerApi->update_scanner: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **registration_id** | **String**| The scanner registration identifier. | + **registration** | [**ScannerRegistrationReq**](ScannerRegistrationReq.md)| A scanner registraiton to be updated. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/ScannerCapability.md b/docs/ScannerCapability.md new file mode 100644 index 0000000..2a38b54 --- /dev/null +++ b/docs/ScannerCapability.md @@ -0,0 +1,9 @@ +# Harbor2Client::ScannerCapability + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**consumes_mime_types** | **Array<String>** | | [optional] +**produces_mime_types** | **Array<String>** | | [optional] + + diff --git a/docs/ScannerRegistration.md b/docs/ScannerRegistration.md new file mode 100644 index 0000000..fc92514 --- /dev/null +++ b/docs/ScannerRegistration.md @@ -0,0 +1,23 @@ +# Harbor2Client::ScannerRegistration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | The unique identifier of this registration. | [optional] +**name** | **String** | The name of this registration. | [optional] +**description** | **String** | An optional description of this registration. | [optional] +**url** | **String** | A base URL of the scanner adapter | [optional] +**disabled** | **BOOLEAN** | Indicate whether the registration is enabled or not | [optional] [default to false] +**is_default** | **BOOLEAN** | Indicate if the registration is set as the system default one | [optional] [default to false] +**auth** | **String** | Specify what authentication approach is adopted for the HTTP communications. Supported types Basic\", \"Bearer\" and api key header \"X-ScannerAdapter-API-Key\" | [optional] [default to ''] +**access_credential** | **String** | An optional value of the HTTP Authorization header sent with each request to the Scanner Adapter API. | [optional] +**skip_cert_verify** | **BOOLEAN** | Indicate if skip the certificate verification when sending HTTP requests | [optional] [default to false] +**use_internal_addr** | **BOOLEAN** | Indicate whether use internal registry addr for the scanner to pull content or not | [optional] [default to false] +**create_time** | **DateTime** | The creation time of this registration | [optional] +**update_time** | **DateTime** | The update time of this registration | [optional] +**adapter** | **String** | Optional property to describe the name of the scanner registration | [optional] +**vendor** | **String** | Optional property to describe the vendor of the scanner registration | [optional] +**version** | **String** | Optional property to describe the version of the scanner registration | [optional] +**health** | **String** | Indicate the healthy of the registration | [optional] [default to ''] + + diff --git a/docs/ScannerRegistrationReq.md b/docs/ScannerRegistrationReq.md new file mode 100644 index 0000000..f696a99 --- /dev/null +++ b/docs/ScannerRegistrationReq.md @@ -0,0 +1,15 @@ +# Harbor2Client::ScannerRegistrationReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The name of this registration | +**description** | **String** | An optional description of this registration. | [optional] +**url** | **String** | A base URL of the scanner adapter. | +**auth** | **String** | Specify what authentication approach is adopted for the HTTP communications. Supported types Basic\", \"Bearer\" and api key header \"X-ScannerAdapter-API-Key\" | [optional] +**access_credential** | **String** | An optional value of the HTTP Authorization header sent with each request to the Scanner Adapter API. | [optional] +**skip_cert_verify** | **BOOLEAN** | Indicate if skip the certificate verification when sending HTTP requests | [optional] [default to false] +**use_internal_addr** | **BOOLEAN** | Indicate whether use internal registry addr for the scanner to pull content or not | [optional] [default to false] +**disabled** | **BOOLEAN** | Indicate whether the registration is enabled or not | [optional] [default to false] + + diff --git a/docs/ScannerRegistrationSettings.md b/docs/ScannerRegistrationSettings.md new file mode 100644 index 0000000..bc2fb7c --- /dev/null +++ b/docs/ScannerRegistrationSettings.md @@ -0,0 +1,11 @@ +# Harbor2Client::ScannerRegistrationSettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The name of this registration | +**url** | **String** | A base URL of the scanner adapter. | +**auth** | **String** | Specify what authentication approach is adopted for the HTTP communications. Supported types Basic\", \"Bearer\" and api key header \"X-ScannerAdapter-API-Key\" | [optional] [default to ''] +**access_credential** | **String** | An optional value of the HTTP Authorization header sent with each request to the Scanner Adapter API. | [optional] + + diff --git a/docs/Schedule.md b/docs/Schedule.md new file mode 100644 index 0000000..39b3b77 --- /dev/null +++ b/docs/Schedule.md @@ -0,0 +1,13 @@ +# Harbor2Client::Schedule + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | The id of the schedule. | [optional] +**status** | **String** | The status of the schedule. | [optional] +**creation_time** | **DateTime** | the creation time of the schedule. | [optional] +**update_time** | **DateTime** | the update time of the schedule. | [optional] +**schedule** | [**ScheduleObj**](ScheduleObj.md) | | [optional] +**parameters** | **Hash<String, Object>** | The parameters of schedule job | [optional] + + diff --git a/docs/ScheduleObj.md b/docs/ScheduleObj.md new file mode 100644 index 0000000..aadc7f8 --- /dev/null +++ b/docs/ScheduleObj.md @@ -0,0 +1,9 @@ +# Harbor2Client::ScheduleObj + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | The schedule type. The valid values are 'Hourly', 'Daily', 'Weekly', 'Custom', 'Manual' and 'None'. 'Manual' means to trigger it right away and 'None' means to cancel the schedule. | [optional] +**cron** | **String** | A cron expression, a time-based job scheduler. | [optional] + + diff --git a/docs/Search.md b/docs/Search.md new file mode 100644 index 0000000..7906889 --- /dev/null +++ b/docs/Search.md @@ -0,0 +1,10 @@ +# Harbor2Client::Search + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**project** | [**Array<Project>**](Project.md) | Search results of the projects that matched the filter keywords. | [optional] +**repository** | [**Array<SearchRepository>**](SearchRepository.md) | Search results of the repositories that matched the filter keywords. | [optional] +**chart** | [**Array<SearchResult>**](SearchResult.md) | Search results of the charts that macthed the filter keywords. | [optional] + + diff --git a/docs/SearchApi.md b/docs/SearchApi.md new file mode 100644 index 0000000..49aef67 --- /dev/null +++ b/docs/SearchApi.md @@ -0,0 +1,66 @@ +# Harbor2Client::SearchApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**search**](SearchApi.md#search) | **GET** /search | Search for projects, repositories and helm charts + + +# **search** +> Search search(q, opts) + +Search for projects, repositories and helm charts + +The Search endpoint returns information about the projects, repositories and helm charts offered at public status or related to the current logged in user. The response includes the project, repository list and charts in a proper display order. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::SearchApi.new + +q = 'q_example' # String | Search parameter for project and repository name. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Search for projects, repositories and helm charts + result = api_instance.search(q, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling SearchApi->search: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **q** | **String**| Search parameter for project and repository name. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**Search**](Search.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/SearchRepository.md b/docs/SearchRepository.md new file mode 100644 index 0000000..a1b5c48 --- /dev/null +++ b/docs/SearchRepository.md @@ -0,0 +1,13 @@ +# Harbor2Client::SearchRepository + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**project_id** | **Integer** | The ID of the project that the repository belongs to | [optional] +**project_name** | **String** | The name of the project that the repository belongs to | [optional] +**project_public** | **BOOLEAN** | The flag to indicate the publicity of the project that the repository belongs to (1 is public, 0 is not) | [optional] +**repository_name** | **String** | The name of the repository | [optional] +**pull_count** | **Integer** | The count how many times the repository is pulled | [optional] +**artifact_count** | **Integer** | The count of artifacts in the repository | [optional] + + diff --git a/docs/SearchResult.md b/docs/SearchResult.md new file mode 100644 index 0000000..994853f --- /dev/null +++ b/docs/SearchResult.md @@ -0,0 +1,10 @@ +# Harbor2Client::SearchResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The chart name with repo name | [optional] +**score** | **Integer** | The matched level | [optional] +**chart** | [**ChartVersion**](ChartVersion.md) | | [optional] + + diff --git a/docs/StartReplicationExecution.md b/docs/StartReplicationExecution.md new file mode 100644 index 0000000..788312a --- /dev/null +++ b/docs/StartReplicationExecution.md @@ -0,0 +1,8 @@ +# Harbor2Client::StartReplicationExecution + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**policy_id** | **Integer** | The ID of policy that the execution belongs to. | [optional] + + diff --git a/docs/Statistic.md b/docs/Statistic.md new file mode 100644 index 0000000..ec40f8d --- /dev/null +++ b/docs/Statistic.md @@ -0,0 +1,14 @@ +# Harbor2Client::Statistic + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**private_project_count** | **Integer** | The count of the private projects | [optional] +**private_repo_count** | **Integer** | The count of the private repositories | [optional] +**public_project_count** | **Integer** | The count of the public projects | [optional] +**public_repo_count** | **Integer** | The count of the public repositories | [optional] +**total_project_count** | **Integer** | The count of the total projects, only be seen by the system admin | [optional] +**total_repo_count** | **Integer** | The count of the total repositories, only be seen by the system admin | [optional] +**total_storage_consumption** | **Integer** | The total storage consumption of blobs, only be seen by the system admin | [optional] + + diff --git a/docs/StatisticApi.md b/docs/StatisticApi.md new file mode 100644 index 0000000..ab0f9dd --- /dev/null +++ b/docs/StatisticApi.md @@ -0,0 +1,63 @@ +# Harbor2Client::StatisticApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_statistic**](StatisticApi.md#get_statistic) | **GET** /statistics | Get the statistic information about the projects and repositories + + +# **get_statistic** +> Statistic get_statistic(opts) + +Get the statistic information about the projects and repositories + +Get the statistic information about the projects and repositories + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::StatisticApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get the statistic information about the projects and repositories + result = api_instance.get_statistic(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling StatisticApi->get_statistic: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**Statistic**](Statistic.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/Stats.md b/docs/Stats.md new file mode 100644 index 0000000..c0cdaca --- /dev/null +++ b/docs/Stats.md @@ -0,0 +1,12 @@ +# Harbor2Client::Stats + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **Integer** | The total number of scan processes triggered by the scan all action | [optional] +**completed** | **Integer** | The number of the finished scan processes triggered by the scan all action | [optional] +**metrics** | **Hash<String, Integer>** | The metrics data for the each status | [optional] +**ongoing** | **BOOLEAN** | A flag indicating job status of scan all. | [optional] +**trigger** | **String** | The trigger of the scan all job. | [optional] + + diff --git a/docs/Storage.md b/docs/Storage.md new file mode 100644 index 0000000..597cc13 --- /dev/null +++ b/docs/Storage.md @@ -0,0 +1,9 @@ +# Harbor2Client::Storage + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **Integer** | Total volume size. | [optional] +**free** | **Integer** | Free volume size. | [optional] + + diff --git a/docs/StringConfigItem.md b/docs/StringConfigItem.md new file mode 100644 index 0000000..2b49301 --- /dev/null +++ b/docs/StringConfigItem.md @@ -0,0 +1,9 @@ +# Harbor2Client::StringConfigItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **String** | The string value of current config item | [optional] +**editable** | **BOOLEAN** | The configure item can be updated or not | [optional] + + diff --git a/docs/SupportedWebhookEventTypes.md b/docs/SupportedWebhookEventTypes.md new file mode 100644 index 0000000..a2503fb --- /dev/null +++ b/docs/SupportedWebhookEventTypes.md @@ -0,0 +1,9 @@ +# Harbor2Client::SupportedWebhookEventTypes + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**event_type** | [**Array<EventType>**](EventType.md) | | [optional] +**notify_type** | [**Array<NotifyType>**](NotifyType.md) | | [optional] + + diff --git a/docs/SystemCVEAllowlistApi.md b/docs/SystemCVEAllowlistApi.md new file mode 100644 index 0000000..b1fb56d --- /dev/null +++ b/docs/SystemCVEAllowlistApi.md @@ -0,0 +1,119 @@ +# Harbor2Client::SystemCVEAllowlistApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_system_cve_allowlist**](SystemCVEAllowlistApi.md#get_system_cve_allowlist) | **GET** /system/CVEAllowlist | Get the system level allowlist of CVE. +[**put_system_cve_allowlist**](SystemCVEAllowlistApi.md#put_system_cve_allowlist) | **PUT** /system/CVEAllowlist | Update the system level allowlist of CVE. + + +# **get_system_cve_allowlist** +> CVEAllowlist get_system_cve_allowlist(opts) + +Get the system level allowlist of CVE. + +Get the system level allowlist of CVE. This API can be called by all authenticated users. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::SystemCVEAllowlistApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get the system level allowlist of CVE. + result = api_instance.get_system_cve_allowlist(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling SystemCVEAllowlistApi->get_system_cve_allowlist: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**CVEAllowlist**](CVEAllowlist.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **put_system_cve_allowlist** +> put_system_cve_allowlist(opts) + +Update the system level allowlist of CVE. + +This API overwrites the system level allowlist of CVE with the list in request body. Only system Admin has permission to call this API. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::SystemCVEAllowlistApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + allowlist: Harbor2Client::CVEAllowlist.new # CVEAllowlist | The allowlist with new content +} + +begin + #Update the system level allowlist of CVE. + api_instance.put_system_cve_allowlist(opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling SystemCVEAllowlistApi->put_system_cve_allowlist: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **allowlist** | [**CVEAllowlist**](CVEAllowlist.md)| The allowlist with new content | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/SystemInfo.md b/docs/SystemInfo.md new file mode 100644 index 0000000..bb1e257 --- /dev/null +++ b/docs/SystemInfo.md @@ -0,0 +1,8 @@ +# Harbor2Client::SystemInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**storage** | [**Array<Storage>**](Storage.md) | The storage of system. | [optional] + + diff --git a/docs/SysteminfoApi.md b/docs/SysteminfoApi.md new file mode 100644 index 0000000..9eccab7 --- /dev/null +++ b/docs/SysteminfoApi.md @@ -0,0 +1,173 @@ +# Harbor2Client::SysteminfoApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_cert**](SysteminfoApi.md#get_cert) | **GET** /systeminfo/getcert | Get default root certificate. +[**get_system_info**](SysteminfoApi.md#get_system_info) | **GET** /systeminfo | Get general system info +[**get_volumes**](SysteminfoApi.md#get_volumes) | **GET** /systeminfo/volumes | Get system volume info (total/free size). + + +# **get_cert** +> File get_cert(opts) + +Get default root certificate. + +This endpoint is for downloading a default root certificate. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::SysteminfoApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get default root certificate. + result = api_instance.get_cert(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling SysteminfoApi->get_cert: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +**File** + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/octet-stream + + + +# **get_system_info** +> GeneralInfo get_system_info(opts) + +Get general system info + +This API is for retrieving general system info, this can be called by anonymous request. Some attributes will be omitted in the response when this API is called by anonymous request. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::SysteminfoApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get general system info + result = api_instance.get_system_info(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling SysteminfoApi->get_system_info: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**GeneralInfo**](GeneralInfo.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_volumes** +> SystemInfo get_volumes(opts) + +Get system volume info (total/free size). + +This endpoint is for retrieving system volume info that only provides for admin user. Note that the response only reflects the storage status of local disk. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::SysteminfoApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get system volume info (total/free size). + result = api_instance.get_volumes(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling SysteminfoApi->get_volumes: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**SystemInfo**](SystemInfo.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/UserApi.md b/docs/UserApi.md new file mode 100644 index 0000000..eeee617 --- /dev/null +++ b/docs/UserApi.md @@ -0,0 +1,647 @@ +# Harbor2Client::UserApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /users | Create a local user. +[**delete_user**](UserApi.md#delete_user) | **DELETE** /users/{user_id} | Mark a registered user as be removed. +[**get_current_user_info**](UserApi.md#get_current_user_info) | **GET** /users/current | Get current user info. +[**get_current_user_permissions**](UserApi.md#get_current_user_permissions) | **GET** /users/current/permissions | Get current user permissions. +[**get_user**](UserApi.md#get_user) | **GET** /users/{user_id} | Get a user's profile. +[**list_users**](UserApi.md#list_users) | **GET** /users | List users +[**search_users**](UserApi.md#search_users) | **GET** /users/search | Search users by username +[**set_cli_secret**](UserApi.md#set_cli_secret) | **PUT** /users/{user_id}/cli_secret | Set CLI secret for a user. +[**set_user_sys_admin**](UserApi.md#set_user_sys_admin) | **PUT** /users/{user_id}/sysadmin | Update a registered user to change to be an administrator of Harbor. +[**update_user_password**](UserApi.md#update_user_password) | **PUT** /users/{user_id}/password | Change the password on a user that already exists. +[**update_user_profile**](UserApi.md#update_user_profile) | **PUT** /users/{user_id} | Update user's profile. + + +# **create_user** +> create_user(user_req, opts) + +Create a local user. + +This API can be used only when the authentication mode is for local DB. When self registration is disabled. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UserApi.new + +user_req = Harbor2Client::UserCreationReq.new # UserCreationReq | The new user + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Create a local user. + api_instance.create_user(user_req, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling UserApi->create_user: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_req** | [**UserCreationReq**](UserCreationReq.md)| The new user | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **delete_user** +> delete_user(user_id, opts) + +Mark a registered user as be removed. + +This endpoint let administrator of Harbor mark a registered user as removed.It actually won't be deleted from DB. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UserApi.new + +user_id = 56 # Integer | User ID for marking as to be removed. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Mark a registered user as be removed. + api_instance.delete_user(user_id, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling UserApi->delete_user: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **Integer**| User ID for marking as to be removed. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_current_user_info** +> UserResp get_current_user_info(opts) + +Get current user info. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UserApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get current user info. + result = api_instance.get_current_user_info(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling UserApi->get_current_user_info: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**UserResp**](UserResp.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_current_user_permissions** +> Array<Permission> get_current_user_permissions(opts) + +Get current user permissions. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UserApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + scope: 'scope_example', # String | The scope for the permission + relative: true # BOOLEAN | If true, the resources in the response are relative to the scope, eg for resource '/project/1/repository' if relative is 'true' then the resource in response will be 'repository'. +} + +begin + #Get current user permissions. + result = api_instance.get_current_user_permissions(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling UserApi->get_current_user_permissions: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **scope** | **String**| The scope for the permission | [optional] + **relative** | **BOOLEAN**| If true, the resources in the response are relative to the scope, eg for resource '/project/1/repository' if relative is 'true' then the resource in response will be 'repository'. | [optional] + +### Return type + +[**Array<Permission>**](Permission.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_user** +> UserResp get_user(user_id, opts) + +Get a user's profile. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UserApi.new + +user_id = 56 # Integer | + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get a user's profile. + result = api_instance.get_user(user_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling UserApi->get_user: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **Integer**| | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**UserResp**](UserResp.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_users** +> Array<UserResp> list_users(opts) + +List users + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UserApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page +} + +begin + #List users + result = api_instance.list_users(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling UserApi->list_users: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + +### Return type + +[**Array<UserResp>**](UserResp.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **search_users** +> Array<UserSearchRespItem> search_users(username, opts) + +Search users by username + +This endpoint is to search the users by username. It's open for all authenticated requests. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UserApi.new + +username = 'username_example' # String | Username for filtering results. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page +} + +begin + #Search users by username + result = api_instance.search_users(username, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling UserApi->search_users: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| Username for filtering results. | + **x_request_id** | **String**| An unique ID for the request | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + +### Return type + +[**Array<UserSearchRespItem>**](UserSearchRespItem.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **set_cli_secret** +> set_cli_secret(user_id, secret, opts) + +Set CLI secret for a user. + +This endpoint let user generate a new CLI secret for himself. This API only works when auth mode is set to 'OIDC'. Once this API returns with successful status, the old secret will be invalid, as there will be only one CLI secret for a user. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UserApi.new + +user_id = 56 # Integer | User ID + +secret = Harbor2Client::OIDCCliSecretReq.new # OIDCCliSecretReq | + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Set CLI secret for a user. + api_instance.set_cli_secret(user_id, secret, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling UserApi->set_cli_secret: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **Integer**| User ID | + **secret** | [**OIDCCliSecretReq**](OIDCCliSecretReq.md)| | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **set_user_sys_admin** +> set_user_sys_admin(user_id, sysadmin_flag, opts) + +Update a registered user to change to be an administrator of Harbor. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UserApi.new + +user_id = 56 # Integer | + +sysadmin_flag = Harbor2Client::UserSysAdminFlag.new # UserSysAdminFlag | Toggle a user to admin or not. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Update a registered user to change to be an administrator of Harbor. + api_instance.set_user_sys_admin(user_id, sysadmin_flag, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling UserApi->set_user_sys_admin: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **Integer**| | + **sysadmin_flag** | [**UserSysAdminFlag**](UserSysAdminFlag.md)| Toggle a user to admin or not. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_user_password** +> update_user_password(user_id, password, opts) + +Change the password on a user that already exists. + +This endpoint is for user to update password. Users with the admin role can change any user's password. Regular users can change only their own password. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UserApi.new + +user_id = 56 # Integer | + +password = Harbor2Client::PasswordReq.new # PasswordReq | Password to be updated, the attribute 'old_password' is optional when the API is called by the system administrator. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Change the password on a user that already exists. + api_instance.update_user_password(user_id, password, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling UserApi->update_user_password: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **Integer**| | + **password** | [**PasswordReq**](PasswordReq.md)| Password to be updated, the attribute 'old_password' is optional when the API is called by the system administrator. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_user_profile** +> update_user_profile(user_id, profile, opts) + +Update user's profile. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UserApi.new + +user_id = 56 # Integer | Registered user ID + +profile = Harbor2Client::UserProfile.new # UserProfile | Only email, realname and comment can be modified. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Update user's profile. + api_instance.update_user_profile(user_id, profile, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling UserApi->update_user_profile: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **Integer**| Registered user ID | + **profile** | [**UserProfile**](UserProfile.md)| Only email, realname and comment can be modified. | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/UserCreationReq.md b/docs/UserCreationReq.md new file mode 100644 index 0000000..abd9a51 --- /dev/null +++ b/docs/UserCreationReq.md @@ -0,0 +1,12 @@ +# Harbor2Client::UserCreationReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | | [optional] +**realname** | **String** | | [optional] +**comment** | **String** | | [optional] +**password** | **String** | | [optional] +**username** | **String** | | [optional] + + diff --git a/docs/UserEntity.md b/docs/UserEntity.md new file mode 100644 index 0000000..cc95d62 --- /dev/null +++ b/docs/UserEntity.md @@ -0,0 +1,9 @@ +# Harbor2Client::UserEntity + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **Integer** | The ID of the user. | [optional] +**username** | **String** | The name of the user. | [optional] + + diff --git a/docs/UserGroup.md b/docs/UserGroup.md new file mode 100644 index 0000000..f221894 --- /dev/null +++ b/docs/UserGroup.md @@ -0,0 +1,11 @@ +# Harbor2Client::UserGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | The ID of the user group | [optional] +**group_name** | **String** | The name of the user group | [optional] +**group_type** | **Integer** | The group type, 1 for LDAP group, 2 for HTTP group. | [optional] +**ldap_group_dn** | **String** | The DN of the LDAP group if group type is 1 (LDAP group). | [optional] + + diff --git a/docs/UserProfile.md b/docs/UserProfile.md new file mode 100644 index 0000000..801ee53 --- /dev/null +++ b/docs/UserProfile.md @@ -0,0 +1,10 @@ +# Harbor2Client::UserProfile + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | | [optional] +**realname** | **String** | | [optional] +**comment** | **String** | | [optional] + + diff --git a/docs/UserResp.md b/docs/UserResp.md new file mode 100644 index 0000000..a50ac4e --- /dev/null +++ b/docs/UserResp.md @@ -0,0 +1,17 @@ +# Harbor2Client::UserResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | | [optional] +**realname** | **String** | | [optional] +**comment** | **String** | | [optional] +**user_id** | **Integer** | | [optional] +**username** | **String** | | [optional] +**sysadmin_flag** | **BOOLEAN** | | [optional] +**admin_role_in_auth** | **BOOLEAN** | indicate the admin privilege is grant by authenticator (LDAP), is always false unless it is the current login user | [optional] +**oidc_user_meta** | [**OIDCUserInfo**](OIDCUserInfo.md) | | [optional] +**creation_time** | **DateTime** | The creation time of the user. | [optional] +**update_time** | **DateTime** | The update time of the user. | [optional] + + diff --git a/docs/UserSearch.md b/docs/UserSearch.md new file mode 100644 index 0000000..8c56bab --- /dev/null +++ b/docs/UserSearch.md @@ -0,0 +1,9 @@ +# Harbor2Client::UserSearch + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **Integer** | The ID of the user. | [optional] +**username** | **String** | | [optional] + + diff --git a/docs/UserSearchRespItem.md b/docs/UserSearchRespItem.md new file mode 100644 index 0000000..e7b58d6 --- /dev/null +++ b/docs/UserSearchRespItem.md @@ -0,0 +1,9 @@ +# Harbor2Client::UserSearchRespItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **Integer** | The ID of the user. | [optional] +**username** | **String** | | [optional] + + diff --git a/docs/UserSysAdminFlag.md b/docs/UserSysAdminFlag.md new file mode 100644 index 0000000..b1669de --- /dev/null +++ b/docs/UserSysAdminFlag.md @@ -0,0 +1,8 @@ +# Harbor2Client::UserSysAdminFlag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sysadmin_flag** | **BOOLEAN** | true-admin, false-not admin. | [optional] + + diff --git a/docs/UsergroupApi.md b/docs/UsergroupApi.md new file mode 100644 index 0000000..1f5f9ea --- /dev/null +++ b/docs/UsergroupApi.md @@ -0,0 +1,293 @@ +# Harbor2Client::UsergroupApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user_group**](UsergroupApi.md#create_user_group) | **POST** /usergroups | Create user group +[**delete_user_group**](UsergroupApi.md#delete_user_group) | **DELETE** /usergroups/{group_id} | Delete user group +[**get_user_group**](UsergroupApi.md#get_user_group) | **GET** /usergroups/{group_id} | Get user group information +[**list_user_groups**](UsergroupApi.md#list_user_groups) | **GET** /usergroups | Get all user groups information +[**update_user_group**](UsergroupApi.md#update_user_group) | **PUT** /usergroups/{group_id} | Update group information + + +# **create_user_group** +> create_user_group(opts) + +Create user group + +Create user group information + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UsergroupApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + usergroup: Harbor2Client::UserGroup.new # UserGroup | +} + +begin + #Create user group + api_instance.create_user_group(opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling UsergroupApi->create_user_group: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + **usergroup** | [**UserGroup**](UserGroup.md)| | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **delete_user_group** +> delete_user_group(group_id, opts) + +Delete user group + +Delete user group + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UsergroupApi.new + +group_id = 56 # Integer | + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Delete user group + api_instance.delete_user_group(group_id, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling UsergroupApi->delete_user_group: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **Integer**| | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_user_group** +> UserGroup get_user_group(group_id, opts) + +Get user group information + +Get user group information + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UsergroupApi.new + +group_id = 789 # Integer | Group ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get user group information + result = api_instance.get_user_group(group_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling UsergroupApi->get_user_group: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **Integer**| Group ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**UserGroup**](UserGroup.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_user_groups** +> Array<UserGroup> list_user_groups(opts) + +Get all user groups information + +Get all user groups information + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UsergroupApi.new + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request +} + +begin + #Get all user groups information + result = api_instance.list_user_groups(opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling UsergroupApi->list_user_groups: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **String**| An unique ID for the request | [optional] + +### Return type + +[**Array<UserGroup>**](UserGroup.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_user_group** +> update_user_group(group_id, opts) + +Update group information + +Update user group information + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::UsergroupApi.new + +group_id = 789 # Integer | Group ID + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + usergroup: Harbor2Client::UserGroup.new # UserGroup | +} + +begin + #Update group information + api_instance.update_user_group(group_id, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling UsergroupApi->update_user_group: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **Integer**| Group ID | + **x_request_id** | **String**| An unique ID for the request | [optional] + **usergroup** | [**UserGroup**](UserGroup.md)| | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/WebhookApi.md b/docs/WebhookApi.md new file mode 100644 index 0000000..3b0ab8e --- /dev/null +++ b/docs/WebhookApi.md @@ -0,0 +1,448 @@ +# Harbor2Client::WebhookApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_webhook_policy_of_project**](WebhookApi.md#create_webhook_policy_of_project) | **POST** /projects/{project_name_or_id}/webhook/policies | Create project webhook policy. +[**delete_webhook_policy_of_project**](WebhookApi.md#delete_webhook_policy_of_project) | **DELETE** /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id} | Delete webhook policy of a project +[**get_supported_event_types**](WebhookApi.md#get_supported_event_types) | **GET** /projects/{project_name_or_id}/webhook/events | Get supported event types and notify types. +[**get_webhook_policy_of_project**](WebhookApi.md#get_webhook_policy_of_project) | **GET** /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id} | Get project webhook policy +[**last_trigger**](WebhookApi.md#last_trigger) | **GET** /projects/{project_name_or_id}/webhook/lasttrigger | Get project webhook policy last trigger info +[**list_webhook_policies_of_project**](WebhookApi.md#list_webhook_policies_of_project) | **GET** /projects/{project_name_or_id}/webhook/policies | List project webhook policies. +[**update_webhook_policy_of_project**](WebhookApi.md#update_webhook_policy_of_project) | **PUT** /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id} | Update webhook policy of a project. + + +# **create_webhook_policy_of_project** +> create_webhook_policy_of_project(project_name_or_idpolicy, opts) + +Create project webhook policy. + +This endpoint create a webhook policy if the project does not have one. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::WebhookApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +policy = Harbor2Client::WebhookPolicy.new # WebhookPolicy | Properties \"targets\" and \"event_types\" needed. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Create project webhook policy. + api_instance.create_webhook_policy_of_project(project_name_or_idpolicy, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling WebhookApi->create_webhook_policy_of_project: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **policy** | [**WebhookPolicy**](WebhookPolicy.md)| Properties \"targets\" and \"event_types\" needed. | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **delete_webhook_policy_of_project** +> delete_webhook_policy_of_project(project_name_or_idwebhook_policy_id, opts) + +Delete webhook policy of a project + +This endpoint is aimed to delete webhookpolicy of a project. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::WebhookApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +webhook_policy_id = 789 # Integer | The ID of the webhook policy + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Delete webhook policy of a project + api_instance.delete_webhook_policy_of_project(project_name_or_idwebhook_policy_id, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling WebhookApi->delete_webhook_policy_of_project: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **webhook_policy_id** | **Integer**| The ID of the webhook policy | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_supported_event_types** +> SupportedWebhookEventTypes get_supported_event_types(project_name_or_id, opts) + +Get supported event types and notify types. + +Get supportted event types and notify types. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::WebhookApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Get supported event types and notify types. + result = api_instance.get_supported_event_types(project_name_or_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling WebhookApi->get_supported_event_types: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +[**SupportedWebhookEventTypes**](SupportedWebhookEventTypes.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **get_webhook_policy_of_project** +> WebhookPolicy get_webhook_policy_of_project(project_name_or_idwebhook_policy_id, opts) + +Get project webhook policy + +This endpoint returns specified webhook policy of a project. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::WebhookApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +webhook_policy_id = 789 # Integer | The ID of the webhook policy + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Get project webhook policy + result = api_instance.get_webhook_policy_of_project(project_name_or_idwebhook_policy_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling WebhookApi->get_webhook_policy_of_project: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **webhook_policy_id** | **Integer**| The ID of the webhook policy | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +[**WebhookPolicy**](WebhookPolicy.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **last_trigger** +> Array<WebhookLastTrigger> last_trigger(project_name_or_id, opts) + +Get project webhook policy last trigger info + +This endpoint returns last trigger information of project webhook policy. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::WebhookApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Get project webhook policy last trigger info + result = api_instance.last_trigger(project_name_or_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling WebhookApi->last_trigger: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +[**Array<WebhookLastTrigger>**](WebhookLastTrigger.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **list_webhook_policies_of_project** +> Array<WebhookPolicy> list_webhook_policies_of_project(project_name_or_id, opts) + +List project webhook policies. + +This endpoint returns webhook policies of a project. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::WebhookApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page +} + +begin + #List project webhook policies. + result = api_instance.list_webhook_policies_of_project(project_name_or_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling WebhookApi->list_webhook_policies_of_project: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + +### Return type + +[**Array<WebhookPolicy>**](WebhookPolicy.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **update_webhook_policy_of_project** +> update_webhook_policy_of_project(project_name_or_idwebhook_policy_idpolicy, opts) + +Update webhook policy of a project. + +This endpoint is aimed to update the webhook policy of a project. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::WebhookApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +webhook_policy_id = 789 # Integer | The ID of the webhook policy + +policy = Harbor2Client::WebhookPolicy.new # WebhookPolicy | All properties needed except \"id\", \"project_id\", \"creation_time\", \"update_time\". + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. +} + +begin + #Update webhook policy of a project. + api_instance.update_webhook_policy_of_project(project_name_or_idwebhook_policy_idpolicy, opts) +rescue Harbor2Client::ApiError => e + puts "Exception when calling WebhookApi->update_webhook_policy_of_project: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **webhook_policy_id** | **Integer**| The ID of the webhook policy | + **policy** | [**WebhookPolicy**](WebhookPolicy.md)| All properties needed except \"id\", \"project_id\", \"creation_time\", \"update_time\". | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + +### Return type + +nil (empty response body) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/WebhookJob.md b/docs/WebhookJob.md new file mode 100644 index 0000000..d6f6c0d --- /dev/null +++ b/docs/WebhookJob.md @@ -0,0 +1,15 @@ +# Harbor2Client::WebhookJob + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | The webhook job ID. | [optional] +**policy_id** | **Integer** | The webhook policy ID. | [optional] +**event_type** | **String** | The webhook job event type. | [optional] +**notify_type** | **String** | The webhook job notify type. | [optional] +**status** | **String** | The webhook job status. | [optional] +**job_detail** | **String** | The webhook job notify detailed data. | [optional] +**creation_time** | **DateTime** | The webhook job creation time. | [optional] +**update_time** | **DateTime** | The webhook job update time. | [optional] + + diff --git a/docs/WebhookLastTrigger.md b/docs/WebhookLastTrigger.md new file mode 100644 index 0000000..a452822 --- /dev/null +++ b/docs/WebhookLastTrigger.md @@ -0,0 +1,12 @@ +# Harbor2Client::WebhookLastTrigger + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**policy_name** | **String** | The webhook policy name. | [optional] +**event_type** | **String** | The webhook event type. | [optional] +**enabled** | **BOOLEAN** | Whether or not the webhook policy enabled. | [optional] +**creation_time** | **DateTime** | The creation time of webhook policy. | [optional] +**last_trigger_time** | **DateTime** | The last trigger time of webhook policy. | [optional] + + diff --git a/docs/WebhookPolicy.md b/docs/WebhookPolicy.md new file mode 100644 index 0000000..c9c7524 --- /dev/null +++ b/docs/WebhookPolicy.md @@ -0,0 +1,17 @@ +# Harbor2Client::WebhookPolicy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | The webhook policy ID. | [optional] +**name** | **String** | The name of webhook policy. | [optional] +**description** | **String** | The description of webhook policy. | [optional] +**project_id** | **Integer** | The project ID of webhook policy. | [optional] +**targets** | [**Array<WebhookTargetObject>**](WebhookTargetObject.md) | | [optional] +**event_types** | **Array<String>** | | [optional] +**creator** | **String** | The creator of the webhook policy. | [optional] +**creation_time** | **DateTime** | The create time of the webhook policy. | [optional] +**update_time** | **DateTime** | The update time of the webhook policy. | [optional] +**enabled** | **BOOLEAN** | Whether the webhook policy is enabled or not. | [optional] + + diff --git a/docs/WebhookTargetObject.md b/docs/WebhookTargetObject.md new file mode 100644 index 0000000..2bb9b6a --- /dev/null +++ b/docs/WebhookTargetObject.md @@ -0,0 +1,11 @@ +# Harbor2Client::WebhookTargetObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | The webhook target notify type. | [optional] +**address** | **String** | The webhook target address. | [optional] +**auth_header** | **String** | The webhook auth header. | [optional] +**skip_cert_verify** | **BOOLEAN** | Whether or not to skip cert verify. | [optional] + + diff --git a/docs/WebhookjobApi.md b/docs/WebhookjobApi.md new file mode 100644 index 0000000..6cb5341 --- /dev/null +++ b/docs/WebhookjobApi.md @@ -0,0 +1,81 @@ +# Harbor2Client::WebhookjobApi + +All URIs are relative to *http://localhost/api/v2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_webhook_jobs**](WebhookjobApi.md#list_webhook_jobs) | **GET** /projects/{project_name_or_id}/webhook/jobs | List project webhook jobs + + +# **list_webhook_jobs** +> Array<WebhookJob> list_webhook_jobs(project_name_or_idpolicy_id, opts) + +List project webhook jobs + +This endpoint returns webhook jobs of a project. + +### Example +```ruby +# load the gem +require 'harbor2_client' +# setup authorization +Harbor2Client.configure do |config| + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Harbor2Client::WebhookjobApi.new + +project_name_or_id = 'project_name_or_id_example' # String | The name or id of the project + +policy_id = 789 # Integer | The policy ID. + +opts = { + x_request_id: 'x_request_id_example' # String | An unique ID for the request + x_is_resource_name: false # BOOLEAN | The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + q: 'q_example', # String | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + sort: 'sort_example', # String | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + page: 1, # Integer | The page number + page_size: 10, # Integer | The size of per page + status: ['status_example'] # Array | The status of webhook job. +} + +begin + #List project webhook jobs + result = api_instance.list_webhook_jobs(project_name_or_idpolicy_id, opts) + p result +rescue Harbor2Client::ApiError => e + puts "Exception when calling WebhookjobApi->list_webhook_jobs: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_name_or_id** | **String**| The name or id of the project | + **policy_id** | **Integer**| The policy ID. | + **x_request_id** | **String**| An unique ID for the request | [optional] + **x_is_resource_name** | **BOOLEAN**| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [optional] [default to false] + **q** | **String**| Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] + **sort** | **String**| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" | [optional] + **page** | **Integer**| The page number | [optional] [default to 1] + **page_size** | **Integer**| The size of per page | [optional] [default to 10] + **status** | [**Array<String>**](String.md)| The status of webhook job. | [optional] + +### Return type + +[**Array<WebhookJob>**](WebhookJob.md) + +### Authorization + +[basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/git_push.sh b/git_push.sh index d43a343..89eb49e 100644 --- a/git_push.sh +++ b/git_push.sh @@ -11,17 +11,17 @@ git_repo_id=$2 release_note=$3 if [ "$git_user_id" = "" ]; then - git_user_id="" + git_user_id="GIT_USER_ID" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" fi if [ "$git_repo_id" = "" ]; then - git_repo_id="" + git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi if [ "$release_note" = "" ]; then - release_note="" + release_note="Minor update" echo "[INFO] No command line input provided. Set \$release_note to $release_note" fi diff --git a/harbor2_client.gemspec b/harbor2_client.gemspec index ae3cf38..f51ac20 100644 --- a/harbor2_client.gemspec +++ b/harbor2_client.gemspec @@ -8,7 +8,7 @@ OpenAPI spec version: 2.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.17 +Swagger Codegen version: 2.4.22 =end @@ -19,12 +19,12 @@ Gem::Specification.new do |s| s.name = "harbor2_client" s.version = Harbor2Client::VERSION s.platform = Gem::Platform::RUBY - s.authors = ["Richard Grainger", "Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/liger1978/ruby-harbor2_client/" - s.summary = "Harbor API Ruby Gem" - s.description = "These APIs provide services for manipulating Harbor projects." - s.license = "MIT" + s.authors = ["Richard Grainger"] + s.email = ["harbottle@room3d3.com"] + s.homepage = "https://github.com/liger1978/ruby-harbor2_client" + s.summary = "A ruby wrapper for the Harbor swagger APIs" + s.description = "A ruby wrapper for the Harbor swagger APIs" + s.license = 'MIT' s.required_ruby_version = ">= 1.9" s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' diff --git a/lib/harbor2_client.rb b/lib/harbor2_client.rb index b0d7560..b911582 100644 --- a/lib/harbor2_client.rb +++ b/lib/harbor2_client.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 2.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.17 +Swagger Codegen version: 2.4.22 =end @@ -17,50 +17,176 @@ require 'harbor2_client/configuration' # Models +require 'harbor2_client/models/access' require 'harbor2_client/models/addition_link' require 'harbor2_client/models/addition_links' require 'harbor2_client/models/annotations' require 'harbor2_client/models/artifact' require 'harbor2_client/models/audit_log' +require 'harbor2_client/models/authproxy_setting' +require 'harbor2_client/models/body' +require 'harbor2_client/models/body_1' +require 'harbor2_client/models/bool_config_item' require 'harbor2_client/models/cve_allowlist' require 'harbor2_client/models/cve_allowlist_item' +require 'harbor2_client/models/chart_metadata' +require 'harbor2_client/models/chart_version' +require 'harbor2_client/models/component_health_status' +require 'harbor2_client/models/configurations' +require 'harbor2_client/models/configurations_response' +require 'harbor2_client/models/configurations_response_scan_all_policy' +require 'harbor2_client/models/configurations_response_scan_all_policy_parameter' +require 'harbor2_client/models/endpoint' require 'harbor2_client/models/error' require 'harbor2_client/models/errors' +require 'harbor2_client/models/event_type' require 'harbor2_client/models/execution' require 'harbor2_client/models/extra_attrs' +require 'harbor2_client/models/filter_style' +require 'harbor2_client/models/gc_history' +require 'harbor2_client/models/general_info' require 'harbor2_client/models/icon' +require 'harbor2_client/models/immutable_rule' +require 'harbor2_client/models/immutable_selector' require 'harbor2_client/models/instance' +require 'harbor2_client/models/integer_config_item' +require 'harbor2_client/models/internal_configurations_response' +require 'harbor2_client/models/is_default' require 'harbor2_client/models/label' +require 'harbor2_client/models/ldap_conf' +require 'harbor2_client/models/ldap_failed_import_user' +require 'harbor2_client/models/ldap_import_users' +require 'harbor2_client/models/ldap_ping_result' +require 'harbor2_client/models/ldap_user' require 'harbor2_client/models/metadata' require 'harbor2_client/models/metrics' require 'harbor2_client/models/native_report_summary' +require 'harbor2_client/models/notify_type' +require 'harbor2_client/models/oidc_cli_secret_req' +require 'harbor2_client/models/oidc_user_info' +require 'harbor2_client/models/overall_health_status' +require 'harbor2_client/models/password_req' +require 'harbor2_client/models/permission' require 'harbor2_client/models/platform' require 'harbor2_client/models/preheat_policy' require 'harbor2_client/models/project' require 'harbor2_client/models/project_deletable' +require 'harbor2_client/models/project_member' +require 'harbor2_client/models/project_member_entity' require 'harbor2_client/models/project_metadata' require 'harbor2_client/models/project_req' +require 'harbor2_client/models/project_scanner' require 'harbor2_client/models/project_summary' require 'harbor2_client/models/project_summary_quota' require 'harbor2_client/models/provider_under_project' +require 'harbor2_client/models/quota' +require 'harbor2_client/models/quota_ref_object' +require 'harbor2_client/models/quota_update_req' require 'harbor2_client/models/reference' require 'harbor2_client/models/registry' require 'harbor2_client/models/registry_credential' +require 'harbor2_client/models/registry_endpoint' +require 'harbor2_client/models/registry_info' +require 'harbor2_client/models/registry_ping' +require 'harbor2_client/models/registry_provider_credential_pattern' +require 'harbor2_client/models/registry_provider_endpoint_pattern' +require 'harbor2_client/models/registry_provider_info' +require 'harbor2_client/models/registry_update' +require 'harbor2_client/models/replication_execution' +require 'harbor2_client/models/replication_filter' +require 'harbor2_client/models/replication_policy' +require 'harbor2_client/models/replication_task' +require 'harbor2_client/models/replication_trigger' +require 'harbor2_client/models/replication_trigger_settings' require 'harbor2_client/models/repository' require 'harbor2_client/models/resource_list' +require 'harbor2_client/models/retention_execution' +require 'harbor2_client/models/retention_execution_task' +require 'harbor2_client/models/retention_metadata' +require 'harbor2_client/models/retention_policy' +require 'harbor2_client/models/retention_policy_scope' +require 'harbor2_client/models/retention_rule' +require 'harbor2_client/models/retention_rule_metadata' +require 'harbor2_client/models/retention_rule_param_metadata' +require 'harbor2_client/models/retention_rule_trigger' +require 'harbor2_client/models/retention_selector' +require 'harbor2_client/models/retention_selector_metadata' +require 'harbor2_client/models/robot' +require 'harbor2_client/models/robot_create' +require 'harbor2_client/models/robot_create_v1' +require 'harbor2_client/models/robot_created' +require 'harbor2_client/models/robot_permission' +require 'harbor2_client/models/robot_sec' +require 'harbor2_client/models/role_request' require 'harbor2_client/models/scan_overview' +require 'harbor2_client/models/scanner' +require 'harbor2_client/models/scanner_adapter_metadata' +require 'harbor2_client/models/scanner_capability' +require 'harbor2_client/models/scanner_registration' +require 'harbor2_client/models/scanner_registration_req' +require 'harbor2_client/models/scanner_registration_settings' +require 'harbor2_client/models/schedule' +require 'harbor2_client/models/schedule_obj' +require 'harbor2_client/models/search' +require 'harbor2_client/models/search_repository' +require 'harbor2_client/models/search_result' +require 'harbor2_client/models/start_replication_execution' +require 'harbor2_client/models/statistic' +require 'harbor2_client/models/stats' +require 'harbor2_client/models/storage' +require 'harbor2_client/models/string_config_item' +require 'harbor2_client/models/supported_webhook_event_types' +require 'harbor2_client/models/system_info' require 'harbor2_client/models/tag' require 'harbor2_client/models/task' +require 'harbor2_client/models/user_creation_req' +require 'harbor2_client/models/user_entity' +require 'harbor2_client/models/user_group' +require 'harbor2_client/models/user_profile' +require 'harbor2_client/models/user_resp' +require 'harbor2_client/models/user_search' +require 'harbor2_client/models/user_search_resp_item' +require 'harbor2_client/models/user_sys_admin_flag' require 'harbor2_client/models/vulnerability_summary' +require 'harbor2_client/models/webhook_job' +require 'harbor2_client/models/webhook_last_trigger' +require 'harbor2_client/models/webhook_policy' +require 'harbor2_client/models/webhook_target_object' # APIs require 'harbor2_client/api/artifact_api' require 'harbor2_client/api/auditlog_api' +require 'harbor2_client/api/configure_api' +require 'harbor2_client/api/gc_api' +require 'harbor2_client/api/health_api' require 'harbor2_client/api/icon_api' +require 'harbor2_client/api/immutable_api' +require 'harbor2_client/api/label_api' +require 'harbor2_client/api/ldap_api' +require 'harbor2_client/api/member_api' +require 'harbor2_client/api/oidc_api' +require 'harbor2_client/api/ping_api' require 'harbor2_client/api/preheat_api' require 'harbor2_client/api/project_api' +require 'harbor2_client/api/project_metadata_api' +require 'harbor2_client/api/quota_api' +require 'harbor2_client/api/registry_api' +require 'harbor2_client/api/replication_api' require 'harbor2_client/api/repository_api' +require 'harbor2_client/api/retention_api' +require 'harbor2_client/api/robot_api' +require 'harbor2_client/api/robotv1_api' require 'harbor2_client/api/scan_api' +require 'harbor2_client/api/scan_all_api' +require 'harbor2_client/api/scanner_api' +require 'harbor2_client/api/search_api' +require 'harbor2_client/api/statistic_api' +require 'harbor2_client/api/system_cve_allowlist_api' +require 'harbor2_client/api/systeminfo_api' +require 'harbor2_client/api/user_api' +require 'harbor2_client/api/usergroup_api' +require 'harbor2_client/api/webhook_api' +require 'harbor2_client/api/webhookjob_api' module Harbor2Client class << self diff --git a/lib/harbor2_client/api/artifact_api.rb b/lib/harbor2_client/api/artifact_api.rb index e77d965..919255d 100644 --- a/lib/harbor2_client/api/artifact_api.rb +++ b/lib/harbor2_client/api/artifact_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 2.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.17 +Swagger Codegen version: 2.4.22 =end @@ -442,8 +442,8 @@ def get_addition_with_http_info(project_name, repository_name, reference, additi fail ArgumentError, "Missing the required parameter 'addition' when calling ArtifactApi.get_addition" end # verify enum value - if @api_client.config.client_side_validation && !['build_history', 'values.yaml', 'readme.md', 'dependencies', 'vulnerabilities'].include?(addition) - fail ArgumentError, "invalid value for 'addition', must be one of build_history, values.yaml, readme.md, dependencies, vulnerabilities" + if @api_client.config.client_side_validation && !['build_history', 'values.yaml', 'readme.md', 'dependencies'].include?(addition) + fail ArgumentError, "invalid value for 'addition', must be one of build_history, values.yaml, readme.md, dependencies" end if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ArtifactApi.get_addition, the character length must be great than or equal to 1.' @@ -490,6 +490,7 @@ def get_addition_with_http_info(project_name, repository_name, reference, additi # @option opts [String] :x_request_id An unique ID for the request # @option opts [Integer] :page The page number (default to 1) # @option opts [Integer] :page_size The size of per page (default to 10) + # @option opts [String] :x_accept_vulnerabilities A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' and 'application/vnd.security.vulnerability.report; version=1.1' (default to application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0) # @option opts [BOOLEAN] :with_tag Specify whether the tags are inclued inside the returning artifacts (default to true) # @option opts [BOOLEAN] :with_label Specify whether the labels are inclued inside the returning artifacts (default to false) # @option opts [BOOLEAN] :with_scan_overview Specify whether the scan overview is inclued inside the returning artifacts (default to false) @@ -510,6 +511,7 @@ def get_artifact(project_name, repository_name, reference, opts = {}) # @option opts [String] :x_request_id An unique ID for the request # @option opts [Integer] :page The page number # @option opts [Integer] :page_size The size of per page + # @option opts [String] :x_accept_vulnerabilities A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' and 'application/vnd.security.vulnerability.report; version=1.1' # @option opts [BOOLEAN] :with_tag Specify whether the tags are inclued inside the returning artifacts # @option opts [BOOLEAN] :with_label Specify whether the labels are inclued inside the returning artifacts # @option opts [BOOLEAN] :with_scan_overview Specify whether the scan overview is inclued inside the returning artifacts @@ -560,6 +562,7 @@ def get_artifact_with_http_info(project_name, repository_name, reference, opts = # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + header_params[:'X-Accept-Vulnerabilities'] = opts[:'x_accept_vulnerabilities'] if !opts[:'x_accept_vulnerabilities'].nil? # form parameters form_params = {} @@ -579,6 +582,82 @@ def get_artifact_with_http_info(project_name, repository_name, reference, opts = end return data, status_code, headers end + # Get the vulnerabilities addition of the specific artifact + # Get the vulnerabilities addition of the artifact specified by the reference under the project and repository. + # @param project_name The name of the project + # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb + # @param reference The reference of the artifact, can be digest or tag + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @option opts [String] :x_accept_vulnerabilities A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' and 'application/vnd.security.vulnerability.report; version=1.1' (default to application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0) + # @return [String] + def get_vulnerabilities_addition(project_name, repository_name, reference, opts = {}) + data, _status_code, _headers = get_vulnerabilities_addition_with_http_info(project_name, repository_name, reference, opts) + data + end + + # Get the vulnerabilities addition of the specific artifact + # Get the vulnerabilities addition of the artifact specified by the reference under the project and repository. + # @param project_name The name of the project + # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb + # @param reference The reference of the artifact, can be digest or tag + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @option opts [String] :x_accept_vulnerabilities A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' and 'application/vnd.security.vulnerability.report; version=1.1' + # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers + def get_vulnerabilities_addition_with_http_info(project_name, repository_name, reference, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ArtifactApi.get_vulnerabilities_addition ...' + end + # verify the required parameter 'project_name' is set + if @api_client.config.client_side_validation && project_name.nil? + fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.get_vulnerabilities_addition" + end + # verify the required parameter 'repository_name' is set + if @api_client.config.client_side_validation && repository_name.nil? + fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.get_vulnerabilities_addition" + end + # verify the required parameter 'reference' is set + if @api_client.config.client_side_validation && reference.nil? + fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.get_vulnerabilities_addition" + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ArtifactApi.get_vulnerabilities_addition, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/vulnerabilities'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + header_params[:'X-Accept-Vulnerabilities'] = opts[:'x_accept_vulnerabilities'] if !opts[:'x_accept_vulnerabilities'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'String') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ArtifactApi#get_vulnerabilities_addition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end # List artifacts # List artifacts under the specific project and repository. Except the basic properties, the other supported queries in \"q\" includes \"tags=*\" to list only tagged artifacts, \"tags=nil\" to list only untagged artifacts, \"tags=~v\" to list artifacts whose tag fuzzy matches \"v\", \"tags=v\" to list artifact whose tag exactly matches \"v\", \"labels=(id1, id2)\" to list artifacts that both labels with id1 and id2 are added to # @param project_name The name of the project @@ -586,8 +665,10 @@ def get_artifact_with_http_info(project_name, repository_name, reference, opts = # @param [Hash] opts the optional parameters # @option opts [String] :x_request_id An unique ID for the request # @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + # @option opts [String] :sort Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" # @option opts [Integer] :page The page number (default to 1) # @option opts [Integer] :page_size The size of per page (default to 10) + # @option opts [String] :x_accept_vulnerabilities A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' and 'application/vnd.security.vulnerability.report; version=1.1' (default to application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0) # @option opts [BOOLEAN] :with_tag Specify whether the tags are included inside the returning artifacts (default to true) # @option opts [BOOLEAN] :with_label Specify whether the labels are included inside the returning artifacts (default to false) # @option opts [BOOLEAN] :with_scan_overview Specify whether the scan overview is included inside the returning artifacts (default to false) @@ -606,8 +687,10 @@ def list_artifacts(project_name, repository_name, opts = {}) # @param [Hash] opts the optional parameters # @option opts [String] :x_request_id An unique ID for the request # @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + # @option opts [String] :sort Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" # @option opts [Integer] :page The page number # @option opts [Integer] :page_size The size of per page + # @option opts [String] :x_accept_vulnerabilities A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it. Currently the mime type supports 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' and 'application/vnd.security.vulnerability.report; version=1.1' # @option opts [BOOLEAN] :with_tag Specify whether the tags are included inside the returning artifacts # @option opts [BOOLEAN] :with_label Specify whether the labels are included inside the returning artifacts # @option opts [BOOLEAN] :with_scan_overview Specify whether the scan overview is included inside the returning artifacts @@ -640,6 +723,7 @@ def list_artifacts_with_http_info(project_name, repository_name, opts = {}) # query parameters query_params = {} query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'with_tag'] = opts[:'with_tag'] if !opts[:'with_tag'].nil? @@ -655,6 +739,7 @@ def list_artifacts_with_http_info(project_name, repository_name, opts = {}) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + header_params[:'X-Accept-Vulnerabilities'] = opts[:'x_accept_vulnerabilities'] if !opts[:'x_accept_vulnerabilities'].nil? # form parameters form_params = {} @@ -682,6 +767,7 @@ def list_artifacts_with_http_info(project_name, repository_name, opts = {}) # @param [Hash] opts the optional parameters # @option opts [String] :x_request_id An unique ID for the request # @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + # @option opts [String] :sort Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" # @option opts [Integer] :page The page number (default to 1) # @option opts [Integer] :page_size The size of per page (default to 10) # @option opts [BOOLEAN] :with_signature Specify whether the signature is included inside the returning tags (default to false) @@ -700,6 +786,7 @@ def list_tags(project_name, repository_name, reference, opts = {}) # @param [Hash] opts the optional parameters # @option opts [String] :x_request_id An unique ID for the request # @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + # @option opts [String] :sort Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" # @option opts [Integer] :page The page number # @option opts [Integer] :page_size The size of per page # @option opts [BOOLEAN] :with_signature Specify whether the signature is included inside the returning tags @@ -735,6 +822,7 @@ def list_tags_with_http_info(project_name, repository_name, reference, opts = {} # query parameters query_params = {} query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'with_signature'] = opts[:'with_signature'] if !opts[:'with_signature'].nil? diff --git a/lib/harbor2_client/api/auditlog_api.rb b/lib/harbor2_client/api/auditlog_api.rb index 2e01a60..6e6c4fb 100644 --- a/lib/harbor2_client/api/auditlog_api.rb +++ b/lib/harbor2_client/api/auditlog_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 2.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.17 +Swagger Codegen version: 2.4.22 =end @@ -24,6 +24,7 @@ def initialize(api_client = ApiClient.default) # @param [Hash] opts the optional parameters # @option opts [String] :x_request_id An unique ID for the request # @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + # @option opts [String] :sort Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" # @option opts [Integer] :page The page number (default to 1) # @option opts [Integer] :page_size The size of per page (default to 10) # @return [Array] @@ -37,6 +38,7 @@ def list_audit_logs(opts = {}) # @param [Hash] opts the optional parameters # @option opts [String] :x_request_id An unique ID for the request # @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + # @option opts [String] :sort Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" # @option opts [Integer] :page The page number # @option opts [Integer] :page_size The size of per page # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers @@ -58,6 +60,7 @@ def list_audit_logs_with_http_info(opts = {}) # query parameters query_params = {} query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? diff --git a/lib/harbor2_client/api/configure_api.rb b/lib/harbor2_client/api/configure_api.rb new file mode 100644 index 0000000..a34edbb --- /dev/null +++ b/lib/harbor2_client/api/configure_api.rb @@ -0,0 +1,193 @@ +=begin +#Harbor API + +#These APIs provide services for manipulating Harbor project. + +OpenAPI spec version: 2.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.22 + +=end + +require 'uri' + +module Harbor2Client + class ConfigureApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Get system configurations. + # This endpoint is for retrieving system configurations that only provides for admin user. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [ConfigurationsResponse] + def get_configurations(opts = {}) + data, _status_code, _headers = get_configurations_with_http_info(opts) + data + end + + # Get system configurations. + # This endpoint is for retrieving system configurations that only provides for admin user. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [Array<(ConfigurationsResponse, Fixnum, Hash)>] ConfigurationsResponse data, response status code and response headers + def get_configurations_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConfigureApi.get_configurations ...' + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ConfigureApi.get_configurations, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/configurations' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConfigurationsResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConfigureApi#get_configurations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get internal configurations. + # This endpoint is for retrieving system configurations that only provides for internal api call. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [InternalConfigurationsResponse] + def get_internalconfig(opts = {}) + data, _status_code, _headers = get_internalconfig_with_http_info(opts) + data + end + + # Get internal configurations. + # This endpoint is for retrieving system configurations that only provides for internal api call. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [Array<(InternalConfigurationsResponse, Fixnum, Hash)>] InternalConfigurationsResponse data, response status code and response headers + def get_internalconfig_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConfigureApi.get_internalconfig ...' + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ConfigureApi.get_internalconfig, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/internalconfig' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'InternalConfigurationsResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConfigureApi#get_internalconfig\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Modify system configurations. + # This endpoint is for modifying system configurations that only provides for admin user. + # @param configurations The configuration map can contain a subset of the attributes of the schema, which are to be updated. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [nil] + def update_configurations(configurations, opts = {}) + update_configurations_with_http_info(configurations, opts) + nil + end + + # Modify system configurations. + # This endpoint is for modifying system configurations that only provides for admin user. + # @param configurations The configuration map can contain a subset of the attributes of the schema, which are to be updated. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def update_configurations_with_http_info(configurations, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConfigureApi.update_configurations ...' + end + # verify the required parameter 'configurations' is set + if @api_client.config.client_side_validation && configurations.nil? + fail ArgumentError, "Missing the required parameter 'configurations' when calling ConfigureApi.update_configurations" + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ConfigureApi.update_configurations, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/configurations' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(configurations) + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConfigureApi#update_configurations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/harbor2_client/api/gc_api.rb b/lib/harbor2_client/api/gc_api.rb new file mode 100644 index 0000000..2318afa --- /dev/null +++ b/lib/harbor2_client/api/gc_api.rb @@ -0,0 +1,391 @@ +=begin +#Harbor API + +#These APIs provide services for manipulating Harbor project. + +OpenAPI spec version: 2.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.22 + +=end + +require 'uri' + +module Harbor2Client + class GcApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Create a gc schedule. + # This endpoint is for update gc schedule. + # @param schedule Updates of gc's schedule. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [nil] + def create_gc_schedule(schedule, opts = {}) + create_gc_schedule_with_http_info(schedule, opts) + nil + end + + # Create a gc schedule. + # This endpoint is for update gc schedule. + # @param schedule Updates of gc's schedule. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def create_gc_schedule_with_http_info(schedule, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GcApi.create_gc_schedule ...' + end + # verify the required parameter 'schedule' is set + if @api_client.config.client_side_validation && schedule.nil? + fail ArgumentError, "Missing the required parameter 'schedule' when calling GcApi.create_gc_schedule" + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling GcApi.create_gc_schedule, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/system/gc/schedule' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(schedule) + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: GcApi#create_gc_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get gc status. + # This endpoint let user get gc status filtered by specific ID. + # @param gc_id The ID of the gc log + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [GCHistory] + def get_gc(gc_id, opts = {}) + data, _status_code, _headers = get_gc_with_http_info(gc_id, opts) + data + end + + # Get gc status. + # This endpoint let user get gc status filtered by specific ID. + # @param gc_id The ID of the gc log + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [Array<(GCHistory, Fixnum, Hash)>] GCHistory data, response status code and response headers + def get_gc_with_http_info(gc_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GcApi.get_gc ...' + end + # verify the required parameter 'gc_id' is set + if @api_client.config.client_side_validation && gc_id.nil? + fail ArgumentError, "Missing the required parameter 'gc_id' when calling GcApi.get_gc" + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling GcApi.get_gc, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/system/gc/{gc_id}'.sub('{' + 'gc_id' + '}', gc_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GCHistory') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: GcApi#get_gc\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get gc results. + # This endpoint let user get gc execution history. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + # @option opts [String] :sort Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + # @option opts [Integer] :page The page number (default to 1) + # @option opts [Integer] :page_size The size of per page (default to 10) + # @return [Array] + def get_gc_history(opts = {}) + data, _status_code, _headers = get_gc_history_with_http_info(opts) + data + end + + # Get gc results. + # This endpoint let user get gc execution history. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + # @option opts [String] :sort Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + # @option opts [Integer] :page The page number + # @option opts [Integer] :page_size The size of per page + # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + def get_gc_history_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GcApi.get_gc_history ...' + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling GcApi.get_gc_history, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling GcApi.get_gc_history, must be smaller than or equal to 100.' + end + + # resource path + local_var_path = '/system/gc' + + # query parameters + query_params = {} + query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Array') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: GcApi#get_gc_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get gc job log. + # This endpoint let user get gc job logs filtered by specific ID. + # @param gc_id The ID of the gc log + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [String] + def get_gc_log(gc_id, opts = {}) + data, _status_code, _headers = get_gc_log_with_http_info(gc_id, opts) + data + end + + # Get gc job log. + # This endpoint let user get gc job logs filtered by specific ID. + # @param gc_id The ID of the gc log + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers + def get_gc_log_with_http_info(gc_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GcApi.get_gc_log ...' + end + # verify the required parameter 'gc_id' is set + if @api_client.config.client_side_validation && gc_id.nil? + fail ArgumentError, "Missing the required parameter 'gc_id' when calling GcApi.get_gc_log" + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling GcApi.get_gc_log, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/system/gc/{gc_id}/log'.sub('{' + 'gc_id' + '}', gc_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'String') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: GcApi#get_gc_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get gc's schedule. + # This endpoint is for get schedule of gc job. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [GCHistory] + def get_gc_schedule(opts = {}) + data, _status_code, _headers = get_gc_schedule_with_http_info(opts) + data + end + + # Get gc's schedule. + # This endpoint is for get schedule of gc job. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [Array<(GCHistory, Fixnum, Hash)>] GCHistory data, response status code and response headers + def get_gc_schedule_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GcApi.get_gc_schedule ...' + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling GcApi.get_gc_schedule, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/system/gc/schedule' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GCHistory') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: GcApi#get_gc_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update gc's schedule. + # This endpoint is for update gc schedule. + # @param schedule Updates of gc's schedule. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [nil] + def update_gc_schedule(schedule, opts = {}) + update_gc_schedule_with_http_info(schedule, opts) + nil + end + + # Update gc's schedule. + # This endpoint is for update gc schedule. + # @param schedule Updates of gc's schedule. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def update_gc_schedule_with_http_info(schedule, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GcApi.update_gc_schedule ...' + end + # verify the required parameter 'schedule' is set + if @api_client.config.client_side_validation && schedule.nil? + fail ArgumentError, "Missing the required parameter 'schedule' when calling GcApi.update_gc_schedule" + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling GcApi.update_gc_schedule, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/system/gc/schedule' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(schedule) + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: GcApi#update_gc_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/harbor2_client/api/health_api.rb b/lib/harbor2_client/api/health_api.rb new file mode 100644 index 0000000..5306929 --- /dev/null +++ b/lib/harbor2_client/api/health_api.rb @@ -0,0 +1,78 @@ +=begin +#Harbor API + +#These APIs provide services for manipulating Harbor project. + +OpenAPI spec version: 2.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.22 + +=end + +require 'uri' + +module Harbor2Client + class HealthApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Check the status of Harbor components + # Check the status of Harbor components + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [OverallHealthStatus] + def get_health(opts = {}) + data, _status_code, _headers = get_health_with_http_info(opts) + data + end + + # Check the status of Harbor components + # Check the status of Harbor components + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [Array<(OverallHealthStatus, Fixnum, Hash)>] OverallHealthStatus data, response status code and response headers + def get_health_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: HealthApi.get_health ...' + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling HealthApi.get_health, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/health' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'OverallHealthStatus') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: HealthApi#get_health\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/harbor2_client/api/icon_api.rb b/lib/harbor2_client/api/icon_api.rb index e860c63..e9d8f2b 100644 --- a/lib/harbor2_client/api/icon_api.rb +++ b/lib/harbor2_client/api/icon_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 2.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.17 +Swagger Codegen version: 2.4.22 =end diff --git a/lib/harbor2_client/api/immutable_api.rb b/lib/harbor2_client/api/immutable_api.rb new file mode 100644 index 0000000..d9fb4ec --- /dev/null +++ b/lib/harbor2_client/api/immutable_api.rb @@ -0,0 +1,312 @@ +=begin +#Harbor API + +#These APIs provide services for manipulating Harbor project. + +OpenAPI spec version: 2.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.22 + +=end + +require 'uri' + +module Harbor2Client + class ImmutableApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Add an immutable tag rule to current project + # This endpoint add an immutable tag rule to the project + # @param project_name_or_id The name or id of the project + # @param immutable_rule + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @option opts [BOOLEAN] :x_is_resource_name The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. (default to false) + # @return [nil] + def create_immu_rule(project_name_or_id, immutable_rule, opts = {}) + create_immu_rule_with_http_info(project_name_or_id, immutable_rule, opts) + nil + end + + # Add an immutable tag rule to current project + # This endpoint add an immutable tag rule to the project + # @param project_name_or_id The name or id of the project + # @param immutable_rule + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @option opts [BOOLEAN] :x_is_resource_name The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def create_immu_rule_with_http_info(project_name_or_id, immutable_rule, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ImmutableApi.create_immu_rule ...' + end + # verify the required parameter 'project_name_or_id' is set + if @api_client.config.client_side_validation && project_name_or_id.nil? + fail ArgumentError, "Missing the required parameter 'project_name_or_id' when calling ImmutableApi.create_immu_rule" + end + # verify the required parameter 'immutable_rule' is set + if @api_client.config.client_side_validation && immutable_rule.nil? + fail ArgumentError, "Missing the required parameter 'immutable_rule' when calling ImmutableApi.create_immu_rule" + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ImmutableApi.create_immu_rule, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/projects/{project_name_or_id}/immutabletagrules'.sub('{' + 'project_name_or_id' + '}', project_name_or_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + header_params[:'X-Is-Resource-Name'] = opts[:'x_is_resource_name'] if !opts[:'x_is_resource_name'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(immutable_rule) + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ImmutableApi#create_immu_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete the immutable tag rule. + # @param project_name_or_id The name or id of the project + # @param immutable_rule_id The ID of the immutable rule + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @option opts [BOOLEAN] :x_is_resource_name The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. (default to false) + # @return [nil] + def delete_immu_rule(project_name_or_id, immutable_rule_id, opts = {}) + delete_immu_rule_with_http_info(project_name_or_id, immutable_rule_id, opts) + nil + end + + # Delete the immutable tag rule. + # @param project_name_or_id The name or id of the project + # @param immutable_rule_id The ID of the immutable rule + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @option opts [BOOLEAN] :x_is_resource_name The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def delete_immu_rule_with_http_info(project_name_or_id, immutable_rule_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ImmutableApi.delete_immu_rule ...' + end + # verify the required parameter 'project_name_or_id' is set + if @api_client.config.client_side_validation && project_name_or_id.nil? + fail ArgumentError, "Missing the required parameter 'project_name_or_id' when calling ImmutableApi.delete_immu_rule" + end + # verify the required parameter 'immutable_rule_id' is set + if @api_client.config.client_side_validation && immutable_rule_id.nil? + fail ArgumentError, "Missing the required parameter 'immutable_rule_id' when calling ImmutableApi.delete_immu_rule" + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ImmutableApi.delete_immu_rule, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/projects/{project_name_or_id}/immutabletagrules/{immutable_rule_id}'.sub('{' + 'project_name_or_id' + '}', project_name_or_id.to_s).sub('{' + 'immutable_rule_id' + '}', immutable_rule_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + header_params[:'X-Is-Resource-Name'] = opts[:'x_is_resource_name'] if !opts[:'x_is_resource_name'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ImmutableApi#delete_immu_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List all immutable tag rules of current project + # This endpoint returns the immutable tag rules of a project + # @param project_name_or_id The name or id of the project + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @option opts [BOOLEAN] :x_is_resource_name The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. (default to false) + # @option opts [Integer] :page The page number (default to 1) + # @option opts [Integer] :page_size The size of per page (default to 10) + # @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + # @option opts [String] :sort Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + # @return [Array] + def list_immu_rules(project_name_or_id, opts = {}) + data, _status_code, _headers = list_immu_rules_with_http_info(project_name_or_id, opts) + data + end + + # List all immutable tag rules of current project + # This endpoint returns the immutable tag rules of a project + # @param project_name_or_id The name or id of the project + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @option opts [BOOLEAN] :x_is_resource_name The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + # @option opts [Integer] :page The page number + # @option opts [Integer] :page_size The size of per page + # @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + # @option opts [String] :sort Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + def list_immu_rules_with_http_info(project_name_or_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ImmutableApi.list_immu_rules ...' + end + # verify the required parameter 'project_name_or_id' is set + if @api_client.config.client_side_validation && project_name_or_id.nil? + fail ArgumentError, "Missing the required parameter 'project_name_or_id' when calling ImmutableApi.list_immu_rules" + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ImmutableApi.list_immu_rules, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ImmutableApi.list_immu_rules, must be smaller than or equal to 100.' + end + + # resource path + local_var_path = '/projects/{project_name_or_id}/immutabletagrules'.sub('{' + 'project_name_or_id' + '}', project_name_or_id.to_s) + + # query parameters + query_params = {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + header_params[:'X-Is-Resource-Name'] = opts[:'x_is_resource_name'] if !opts[:'x_is_resource_name'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Array') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ImmutableApi#list_immu_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update the immutable tag rule or enable or disable the rule + # @param project_name_or_id The name or id of the project + # @param immutable_rule_id The ID of the immutable rule + # @param immutable_rule + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @option opts [BOOLEAN] :x_is_resource_name The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. (default to false) + # @return [nil] + def update_immu_rule(project_name_or_id, immutable_rule_id, immutable_rule, opts = {}) + update_immu_rule_with_http_info(project_name_or_id, immutable_rule_id, immutable_rule, opts) + nil + end + + # Update the immutable tag rule or enable or disable the rule + # @param project_name_or_id The name or id of the project + # @param immutable_rule_id The ID of the immutable rule + # @param immutable_rule + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @option opts [BOOLEAN] :x_is_resource_name The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def update_immu_rule_with_http_info(project_name_or_id, immutable_rule_id, immutable_rule, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ImmutableApi.update_immu_rule ...' + end + # verify the required parameter 'project_name_or_id' is set + if @api_client.config.client_side_validation && project_name_or_id.nil? + fail ArgumentError, "Missing the required parameter 'project_name_or_id' when calling ImmutableApi.update_immu_rule" + end + # verify the required parameter 'immutable_rule_id' is set + if @api_client.config.client_side_validation && immutable_rule_id.nil? + fail ArgumentError, "Missing the required parameter 'immutable_rule_id' when calling ImmutableApi.update_immu_rule" + end + # verify the required parameter 'immutable_rule' is set + if @api_client.config.client_side_validation && immutable_rule.nil? + fail ArgumentError, "Missing the required parameter 'immutable_rule' when calling ImmutableApi.update_immu_rule" + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ImmutableApi.update_immu_rule, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/projects/{project_name_or_id}/immutabletagrules/{immutable_rule_id}'.sub('{' + 'project_name_or_id' + '}', project_name_or_id.to_s).sub('{' + 'immutable_rule_id' + '}', immutable_rule_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + header_params[:'X-Is-Resource-Name'] = opts[:'x_is_resource_name'] if !opts[:'x_is_resource_name'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(immutable_rule) + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ImmutableApi#update_immu_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/harbor2_client/api/label_api.rb b/lib/harbor2_client/api/label_api.rb new file mode 100644 index 0000000..02270a8 --- /dev/null +++ b/lib/harbor2_client/api/label_api.rb @@ -0,0 +1,350 @@ +=begin +#Harbor API + +#These APIs provide services for manipulating Harbor project. + +OpenAPI spec version: 2.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.22 + +=end + +require 'uri' + +module Harbor2Client + class LabelApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Post creates a label + # This endpoint let user creates a label. + # @param label The json object of label. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [nil] + def create_label(label, opts = {}) + create_label_with_http_info(label, opts) + nil + end + + # Post creates a label + # This endpoint let user creates a label. + # @param label The json object of label. + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def create_label_with_http_info(label, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LabelApi.create_label ...' + end + # verify the required parameter 'label' is set + if @api_client.config.client_side_validation && label.nil? + fail ArgumentError, "Missing the required parameter 'label' when calling LabelApi.create_label" + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling LabelApi.create_label, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/labels' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(label) + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LabelApi#create_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete the label specified by ID. + # Delete the label specified by ID. + # @param label_id Label ID + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [nil] + def delete_label(label_id, opts = {}) + delete_label_with_http_info(label_id, opts) + nil + end + + # Delete the label specified by ID. + # Delete the label specified by ID. + # @param label_id Label ID + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def delete_label_with_http_info(label_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LabelApi.delete_label ...' + end + # verify the required parameter 'label_id' is set + if @api_client.config.client_side_validation && label_id.nil? + fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelApi.delete_label" + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling LabelApi.delete_label, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/labels/{label_id}'.sub('{' + 'label_id' + '}', label_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LabelApi#delete_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get the label specified by ID. + # This endpoint let user get the label by specific ID. + # @param label_id Label ID + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [Label] + def get_label_by_id(label_id, opts = {}) + data, _status_code, _headers = get_label_by_id_with_http_info(label_id, opts) + data + end + + # Get the label specified by ID. + # This endpoint let user get the label by specific ID. + # @param label_id Label ID + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @return [Array<(Label, Fixnum, Hash)>] Label data, response status code and response headers + def get_label_by_id_with_http_info(label_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LabelApi.get_label_by_id ...' + end + # verify the required parameter 'label_id' is set + if @api_client.config.client_side_validation && label_id.nil? + fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelApi.get_label_by_id" + end + if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling LabelApi.get_label_by_id, the character length must be great than or equal to 1.' + end + + # resource path + local_var_path = '/labels/{label_id}'.sub('{' + 'label_id' + '}', label_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['basic'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Label') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LabelApi#get_label_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List labels according to the query strings. + # This endpoint let user list labels by name, scope and project_id + # @param [Hash] opts the optional parameters + # @option opts [String] :x_request_id An unique ID for the request + # @option opts [String] :q Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] + # @option opts [String] :sort Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" + # @option opts [Integer] :page The page number (default to 1) + # @option opts [Integer] :page_size The size of per page (default to 10) + # @option opts [String] :name The label name. + # @option opts [String] :scope The label scope. Valid values are g and p. g for global labels and p for project labels. + # @option opts [Integer] :project_id Relevant project ID, required when scope is p. + # @return [Array