vsphere-automation-content 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +79 -0
- data/README.md +229 -0
- data/Rakefile +10 -0
- data/docs/ConfigurationApi.md +91 -0
- data/docs/ContentConfigurationModel.md +11 -0
- data/docs/ContentConfigurationResult.md +8 -0
- data/docs/ContentConfigurationUpdate.md +8 -0
- data/docs/ContentLibraryFind.md +8 -0
- data/docs/ContentLibraryFindResult.md +8 -0
- data/docs/ContentLibraryFindSpec.md +9 -0
- data/docs/ContentLibraryItemCopy.md +9 -0
- data/docs/ContentLibraryItemCopyResult.md +8 -0
- data/docs/ContentLibraryItemCreate.md +9 -0
- data/docs/ContentLibraryItemCreateResult.md +8 -0
- data/docs/ContentLibraryItemDownloadSessionCreate.md +9 -0
- data/docs/ContentLibraryItemDownloadSessionCreateResult.md +8 -0
- data/docs/ContentLibraryItemDownloadSessionFail.md +8 -0
- data/docs/ContentLibraryItemDownloadSessionKeepAlive.md +8 -0
- data/docs/ContentLibraryItemDownloadSessionListResult.md +8 -0
- data/docs/ContentLibraryItemDownloadSessionModel.md +14 -0
- data/docs/ContentLibraryItemDownloadSessionModelState.md +7 -0
- data/docs/ContentLibraryItemDownloadSessionResult.md +8 -0
- data/docs/ContentLibraryItemDownloadsessionFileEndpointType.md +7 -0
- data/docs/ContentLibraryItemDownloadsessionFileGet.md +8 -0
- data/docs/ContentLibraryItemDownloadsessionFileInfo.md +14 -0
- data/docs/ContentLibraryItemDownloadsessionFileListResult.md +8 -0
- data/docs/ContentLibraryItemDownloadsessionFilePrepare.md +9 -0
- data/docs/ContentLibraryItemDownloadsessionFilePrepareResult.md +8 -0
- data/docs/ContentLibraryItemDownloadsessionFilePrepareStatus.md +7 -0
- data/docs/ContentLibraryItemDownloadsessionFileResult.md +8 -0
- data/docs/ContentLibraryItemFileChecksumAlgorithm.md +7 -0
- data/docs/ContentLibraryItemFileChecksumInfo.md +9 -0
- data/docs/ContentLibraryItemFileGet.md +8 -0
- data/docs/ContentLibraryItemFileInfo.md +12 -0
- data/docs/ContentLibraryItemFileListResult.md +8 -0
- data/docs/ContentLibraryItemFileResult.md +8 -0
- data/docs/ContentLibraryItemFind.md +8 -0
- data/docs/ContentLibraryItemFindResult.md +8 -0
- data/docs/ContentLibraryItemFindSpec.md +12 -0
- data/docs/ContentLibraryItemListResult.md +8 -0
- data/docs/ContentLibraryItemModel.md +21 -0
- data/docs/ContentLibraryItemResult.md +8 -0
- data/docs/ContentLibraryItemStorageGet.md +8 -0
- data/docs/ContentLibraryItemStorageInfo.md +14 -0
- data/docs/ContentLibraryItemStorageListResult.md +8 -0
- data/docs/ContentLibraryItemStorageResult.md +8 -0
- data/docs/ContentLibraryItemTransferEndpoint.md +9 -0
- data/docs/ContentLibraryItemTransferStatus.md +7 -0
- data/docs/ContentLibraryItemUpdate.md +8 -0
- data/docs/ContentLibraryItemUpdateSessionCreate.md +9 -0
- data/docs/ContentLibraryItemUpdateSessionCreateResult.md +8 -0
- data/docs/ContentLibraryItemUpdateSessionFail.md +8 -0
- data/docs/ContentLibraryItemUpdateSessionKeepAlive.md +8 -0
- data/docs/ContentLibraryItemUpdateSessionListResult.md +8 -0
- data/docs/ContentLibraryItemUpdateSessionModel.md +16 -0
- data/docs/ContentLibraryItemUpdateSessionModelState.md +7 -0
- data/docs/ContentLibraryItemUpdateSessionResult.md +8 -0
- data/docs/ContentLibraryItemUpdateSessionUpdate.md +8 -0
- data/docs/ContentLibraryItemUpdatesessionCertificateInfo.md +11 -0
- data/docs/ContentLibraryItemUpdatesessionFileAdd.md +8 -0
- data/docs/ContentLibraryItemUpdatesessionFileAddResult.md +8 -0
- data/docs/ContentLibraryItemUpdatesessionFileAddSpec.md +12 -0
- data/docs/ContentLibraryItemUpdatesessionFileGet.md +8 -0
- data/docs/ContentLibraryItemUpdatesessionFileInfo.md +17 -0
- data/docs/ContentLibraryItemUpdatesessionFileListResult.md +8 -0
- data/docs/ContentLibraryItemUpdatesessionFileRemove.md +8 -0
- data/docs/ContentLibraryItemUpdatesessionFileResult.md +8 -0
- data/docs/ContentLibraryItemUpdatesessionFileSourceType.md +7 -0
- data/docs/ContentLibraryItemUpdatesessionFileValidateResult.md +8 -0
- data/docs/ContentLibraryItemUpdatesessionFileValidationError.md +9 -0
- data/docs/ContentLibraryItemUpdatesessionFileValidationResult.md +10 -0
- data/docs/ContentLibraryItemUpdatesessionPreviewInfo.md +10 -0
- data/docs/ContentLibraryItemUpdatesessionPreviewInfoState.md +7 -0
- data/docs/ContentLibraryItemUpdatesessionPreviewWarningInfo.md +10 -0
- data/docs/ContentLibraryItemUpdatesessionWarningBehavior.md +9 -0
- data/docs/ContentLibraryItemUpdatesessionWarningType.md +7 -0
- data/docs/ContentLibraryListResult.md +8 -0
- data/docs/ContentLibraryModel.md +20 -0
- data/docs/ContentLibraryModelLibraryType.md +7 -0
- data/docs/ContentLibraryOptimizationInfo.md +8 -0
- data/docs/ContentLibraryPublishInfo.md +14 -0
- data/docs/ContentLibraryPublishInfoAuthenticationMethod.md +7 -0
- data/docs/ContentLibraryResult.md +8 -0
- data/docs/ContentLibraryStorageBacking.md +10 -0
- data/docs/ContentLibraryStorageBackingType.md +7 -0
- data/docs/ContentLibrarySubscribedItemSync.md +8 -0
- data/docs/ContentLibrarySubscriptionInfo.md +14 -0
- data/docs/ContentLibrarySubscriptionInfoAuthenticationMethod.md +7 -0
- data/docs/ContentLibraryUpdate.md +8 -0
- data/docs/ContentLocalLibraryCreate.md +9 -0
- data/docs/ContentLocalLibraryCreateResult.md +8 -0
- data/docs/ContentLocalLibraryListResult.md +8 -0
- data/docs/ContentLocalLibraryResult.md +8 -0
- data/docs/ContentLocalLibraryUpdate.md +8 -0
- data/docs/ContentSubscribedLibraryCreate.md +9 -0
- data/docs/ContentSubscribedLibraryCreateResult.md +8 -0
- data/docs/ContentSubscribedLibraryListResult.md +8 -0
- data/docs/ContentSubscribedLibraryProbe.md +8 -0
- data/docs/ContentSubscribedLibraryProbeResult.md +10 -0
- data/docs/ContentSubscribedLibraryProbeResultStatus.md +7 -0
- data/docs/ContentSubscribedLibraryResult.md +8 -0
- data/docs/ContentSubscribedLibraryUpdate.md +8 -0
- data/docs/LibraryApi.md +181 -0
- data/docs/LibraryItemApi.md +318 -0
- data/docs/LibraryItemDownloadSessionApi.md +320 -0
- data/docs/LibraryItemDownloadsessionFileApi.md +144 -0
- data/docs/LibraryItemFileApi.md +98 -0
- data/docs/LibraryItemStorageApi.md +98 -0
- data/docs/LibraryItemUpdateSessionApi.md +408 -0
- data/docs/LibraryItemUpdatesessionFileApi.md +233 -0
- data/docs/LibrarySubscribedItemApi.md +96 -0
- data/docs/LocalLibraryApi.md +224 -0
- data/docs/SubscribedLibraryApi.md +354 -0
- data/docs/VapiStdErrorsConcurrentChange.md +9 -0
- data/docs/VapiStdErrorsConcurrentChangeError.md +9 -0
- data/docs/VapiStdErrorsInvalidArgument.md +9 -0
- data/docs/VapiStdErrorsInvalidArgumentError.md +9 -0
- data/docs/VapiStdErrorsInvalidElementConfiguration.md +9 -0
- data/docs/VapiStdErrorsInvalidElementConfigurationError.md +9 -0
- data/docs/VapiStdErrorsInvalidElementType.md +9 -0
- data/docs/VapiStdErrorsInvalidElementTypeError.md +9 -0
- data/docs/VapiStdErrorsNotAllowedInCurrentState.md +9 -0
- data/docs/VapiStdErrorsNotAllowedInCurrentStateError.md +9 -0
- data/docs/VapiStdErrorsNotFound.md +9 -0
- data/docs/VapiStdErrorsNotFoundError.md +9 -0
- data/docs/VapiStdErrorsResourceBusy.md +9 -0
- data/docs/VapiStdErrorsResourceBusyError.md +9 -0
- data/docs/VapiStdErrorsResourceInaccessible.md +9 -0
- data/docs/VapiStdErrorsResourceInaccessibleError.md +9 -0
- data/docs/VapiStdErrorsUnauthorized.md +9 -0
- data/docs/VapiStdErrorsUnauthorizedError.md +9 -0
- data/docs/VapiStdErrorsUnsupported.md +9 -0
- data/docs/VapiStdErrorsUnsupportedError.md +9 -0
- data/docs/VapiStdLocalizableMessage.md +10 -0
- data/git_push.sh +55 -0
- data/lib/vsphere-automation-content.rb +168 -0
- data/lib/vsphere-automation-content/api/configuration_api.rb +122 -0
- data/lib/vsphere-automation-content/api/library_api.rb +238 -0
- data/lib/vsphere-automation-content/api/library_item_api.rb +416 -0
- data/lib/vsphere-automation-content/api/library_item_download_session_api.rb +397 -0
- data/lib/vsphere-automation-content/api/library_item_downloadsession_file_api.rb +205 -0
- data/lib/vsphere-automation-content/api/library_item_file_api.rb +140 -0
- data/lib/vsphere-automation-content/api/library_item_storage_api.rb +140 -0
- data/lib/vsphere-automation-content/api/library_item_update_session_api.rb +505 -0
- data/lib/vsphere-automation-content/api/library_item_updatesession_file_api.rb +318 -0
- data/lib/vsphere-automation-content/api/library_subscribed_item_api.rb +131 -0
- data/lib/vsphere-automation-content/api/local_library_api.rb +289 -0
- data/lib/vsphere-automation-content/api/subscribed_library_api.rb +444 -0
- data/lib/vsphere-automation-content/api_client.rb +386 -0
- data/lib/vsphere-automation-content/api_error.rb +36 -0
- data/lib/vsphere-automation-content/configuration.rb +200 -0
- data/lib/vsphere-automation-content/models/content_configuration_model.rb +214 -0
- data/lib/vsphere-automation-content/models/content_configuration_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_configuration_update.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_find.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_find_result.rb +190 -0
- data/lib/vsphere-automation-content/models/content_library_find_spec.rb +193 -0
- data/lib/vsphere-automation-content/models/content_library_item_copy.rb +198 -0
- data/lib/vsphere-automation-content/models/content_library_item_copy_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_create.rb +198 -0
- data/lib/vsphere-automation-content/models/content_library_item_create_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_download_session_create.rb +198 -0
- data/lib/vsphere-automation-content/models/content_library_item_download_session_create_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_download_session_fail.rb +189 -0
- data/lib/vsphere-automation-content/models/content_library_item_download_session_keep_alive.rb +184 -0
- data/lib/vsphere-automation-content/models/content_library_item_download_session_list_result.rb +190 -0
- data/lib/vsphere-automation-content/models/content_library_item_download_session_model.rb +242 -0
- data/lib/vsphere-automation-content/models/content_library_item_download_session_model_state.rb +31 -0
- data/lib/vsphere-automation-content/models/content_library_item_download_session_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_downloadsession_file_endpoint_type.rb +30 -0
- data/lib/vsphere-automation-content/models/content_library_item_downloadsession_file_get.rb +189 -0
- data/lib/vsphere-automation-content/models/content_library_item_downloadsession_file_info.rb +255 -0
- data/lib/vsphere-automation-content/models/content_library_item_downloadsession_file_list_result.rb +190 -0
- data/lib/vsphere-automation-content/models/content_library_item_downloadsession_file_prepare.rb +198 -0
- data/lib/vsphere-automation-content/models/content_library_item_downloadsession_file_prepare_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_downloadsession_file_prepare_status.rb +33 -0
- data/lib/vsphere-automation-content/models/content_library_item_downloadsession_file_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_file_checksum_algorithm.rb +32 -0
- data/lib/vsphere-automation-content/models/content_library_item_file_checksum_info.rb +198 -0
- data/lib/vsphere-automation-content/models/content_library_item_file_get.rb +189 -0
- data/lib/vsphere-automation-content/models/content_library_item_file_info.rb +243 -0
- data/lib/vsphere-automation-content/models/content_library_item_file_list_result.rb +190 -0
- data/lib/vsphere-automation-content/models/content_library_item_file_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_find.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_find_result.rb +190 -0
- data/lib/vsphere-automation-content/models/content_library_item_find_spec.rb +224 -0
- data/lib/vsphere-automation-content/models/content_library_item_list_result.rb +190 -0
- data/lib/vsphere-automation-content/models/content_library_item_model.rb +314 -0
- data/lib/vsphere-automation-content/models/content_library_item_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_storage_get.rb +189 -0
- data/lib/vsphere-automation-content/models/content_library_item_storage_info.rb +274 -0
- data/lib/vsphere-automation-content/models/content_library_item_storage_list_result.rb +190 -0
- data/lib/vsphere-automation-content/models/content_library_item_storage_result.rb +190 -0
- data/lib/vsphere-automation-content/models/content_library_item_transfer_endpoint.rb +199 -0
- data/lib/vsphere-automation-content/models/content_library_item_transfer_status.rb +33 -0
- data/lib/vsphere-automation-content/models/content_library_item_update.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_update_session_create.rb +198 -0
- data/lib/vsphere-automation-content/models/content_library_item_update_session_create_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_update_session_fail.rb +189 -0
- data/lib/vsphere-automation-content/models/content_library_item_update_session_keep_alive.rb +184 -0
- data/lib/vsphere-automation-content/models/content_library_item_update_session_list_result.rb +190 -0
- data/lib/vsphere-automation-content/models/content_library_item_update_session_model.rb +263 -0
- data/lib/vsphere-automation-content/models/content_library_item_update_session_model_state.rb +32 -0
- data/lib/vsphere-automation-content/models/content_library_item_update_session_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_update_session_update.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_certificate_info.rb +234 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_file_add.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_file_add_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_file_add_spec.rb +231 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_file_get.rb +189 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_file_info.rb +288 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_file_list_result.rb +190 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_file_remove.rb +189 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_file_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_file_source_type.rb +31 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_file_validate_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_file_validation_error.rb +203 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_file_validation_result.rb +223 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_preview_info.rb +209 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_preview_info_state.rb +32 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_preview_warning_info.rb +217 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_warning_behavior.rb +203 -0
- data/lib/vsphere-automation-content/models/content_library_item_updatesession_warning_type.rb +32 -0
- data/lib/vsphere-automation-content/models/content_library_list_result.rb +190 -0
- data/lib/vsphere-automation-content/models/content_library_model.rb +302 -0
- data/lib/vsphere-automation-content/models/content_library_model_library_type.rb +30 -0
- data/lib/vsphere-automation-content/models/content_library_optimization_info.rb +184 -0
- data/lib/vsphere-automation-content/models/content_library_publish_info.rb +243 -0
- data/lib/vsphere-automation-content/models/content_library_publish_info_authentication_method.rb +30 -0
- data/lib/vsphere-automation-content/models/content_library_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_library_storage_backing.rb +203 -0
- data/lib/vsphere-automation-content/models/content_library_storage_backing_type.rb +30 -0
- data/lib/vsphere-automation-content/models/content_library_subscribed_item_sync.rb +189 -0
- data/lib/vsphere-automation-content/models/content_library_subscription_info.rb +243 -0
- data/lib/vsphere-automation-content/models/content_library_subscription_info_authentication_method.rb +30 -0
- data/lib/vsphere-automation-content/models/content_library_update.rb +188 -0
- data/lib/vsphere-automation-content/models/content_local_library_create.rb +198 -0
- data/lib/vsphere-automation-content/models/content_local_library_create_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_local_library_list_result.rb +190 -0
- data/lib/vsphere-automation-content/models/content_local_library_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_local_library_update.rb +188 -0
- data/lib/vsphere-automation-content/models/content_subscribed_library_create.rb +198 -0
- data/lib/vsphere-automation-content/models/content_subscribed_library_create_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_subscribed_library_list_result.rb +190 -0
- data/lib/vsphere-automation-content/models/content_subscribed_library_probe.rb +188 -0
- data/lib/vsphere-automation-content/models/content_subscribed_library_probe_result.rb +215 -0
- data/lib/vsphere-automation-content/models/content_subscribed_library_probe_result_status.rb +36 -0
- data/lib/vsphere-automation-content/models/content_subscribed_library_result.rb +188 -0
- data/lib/vsphere-automation-content/models/content_subscribed_library_update.rb +188 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_concurrent_change.rb +201 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_concurrent_change_error.rb +192 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_invalid_argument.rb +201 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_invalid_argument_error.rb +192 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_invalid_element_configuration.rb +201 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_invalid_element_configuration_error.rb +192 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_invalid_element_type.rb +201 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_invalid_element_type_error.rb +192 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_not_allowed_in_current_state.rb +201 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_not_allowed_in_current_state_error.rb +192 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_not_found.rb +201 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_not_found_error.rb +192 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_resource_busy.rb +201 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_resource_busy_error.rb +192 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_resource_inaccessible.rb +201 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_resource_inaccessible_error.rb +192 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_unauthorized.rb +201 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_unauthorized_error.rb +192 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_unsupported.rb +201 -0
- data/lib/vsphere-automation-content/models/vapi_std_errors_unsupported_error.rb +192 -0
- data/lib/vsphere-automation-content/models/vapi_std_localizable_message.rb +221 -0
- data/lib/vsphere-automation-content/version.rb +15 -0
- data/spec/api/configuration_api_spec.rb +54 -0
- data/spec/api/library_api_spec.rb +77 -0
- data/spec/api/library_item_api_spec.rb +112 -0
- data/spec/api/library_item_download_session_api_spec.rb +112 -0
- data/spec/api/library_item_downloadsession_file_api_spec.rb +68 -0
- data/spec/api/library_item_file_api_spec.rb +56 -0
- data/spec/api/library_item_storage_api_spec.rb +56 -0
- data/spec/api/library_item_update_session_api_spec.rb +135 -0
- data/spec/api/library_item_updatesession_file_api_spec.rb +91 -0
- data/spec/api/library_subscribed_item_api_spec.rb +56 -0
- data/spec/api/local_library_api_spec.rb +88 -0
- data/spec/api/subscribed_library_api_spec.rb +121 -0
- data/spec/api_client_spec.rb +224 -0
- data/spec/configuration_spec.rb +40 -0
- data/spec/models/content_configuration_model_spec.rb +57 -0
- data/spec/models/content_configuration_result_spec.rb +39 -0
- data/spec/models/content_configuration_update_spec.rb +39 -0
- data/spec/models/content_library_find_result_spec.rb +39 -0
- data/spec/models/content_library_find_spec.rb +39 -0
- data/spec/models/content_library_find_spec_spec.rb +45 -0
- data/spec/models/content_library_item_copy_result_spec.rb +39 -0
- data/spec/models/content_library_item_copy_spec.rb +45 -0
- data/spec/models/content_library_item_create_result_spec.rb +39 -0
- data/spec/models/content_library_item_create_spec.rb +45 -0
- data/spec/models/content_library_item_download_session_create_result_spec.rb +39 -0
- data/spec/models/content_library_item_download_session_create_spec.rb +45 -0
- data/spec/models/content_library_item_download_session_fail_spec.rb +39 -0
- data/spec/models/content_library_item_download_session_keep_alive_spec.rb +39 -0
- data/spec/models/content_library_item_download_session_list_result_spec.rb +39 -0
- data/spec/models/content_library_item_download_session_model_spec.rb +75 -0
- data/spec/models/content_library_item_download_session_model_state_spec.rb +33 -0
- data/spec/models/content_library_item_download_session_result_spec.rb +39 -0
- data/spec/models/content_library_item_downloadsession_file_endpoint_type_spec.rb +33 -0
- data/spec/models/content_library_item_downloadsession_file_get_spec.rb +39 -0
- data/spec/models/content_library_item_downloadsession_file_info_spec.rb +75 -0
- data/spec/models/content_library_item_downloadsession_file_list_result_spec.rb +39 -0
- data/spec/models/content_library_item_downloadsession_file_prepare_result_spec.rb +39 -0
- data/spec/models/content_library_item_downloadsession_file_prepare_spec.rb +45 -0
- data/spec/models/content_library_item_downloadsession_file_prepare_status_spec.rb +33 -0
- data/spec/models/content_library_item_downloadsession_file_result_spec.rb +39 -0
- data/spec/models/content_library_item_file_checksum_algorithm_spec.rb +33 -0
- data/spec/models/content_library_item_file_checksum_info_spec.rb +45 -0
- data/spec/models/content_library_item_file_get_spec.rb +39 -0
- data/spec/models/content_library_item_file_info_spec.rb +63 -0
- data/spec/models/content_library_item_file_list_result_spec.rb +39 -0
- data/spec/models/content_library_item_file_result_spec.rb +39 -0
- data/spec/models/content_library_item_find_result_spec.rb +39 -0
- data/spec/models/content_library_item_find_spec.rb +39 -0
- data/spec/models/content_library_item_find_spec_spec.rb +63 -0
- data/spec/models/content_library_item_list_result_spec.rb +39 -0
- data/spec/models/content_library_item_model_spec.rb +117 -0
- data/spec/models/content_library_item_result_spec.rb +39 -0
- data/spec/models/content_library_item_storage_get_spec.rb +39 -0
- data/spec/models/content_library_item_storage_info_spec.rb +75 -0
- data/spec/models/content_library_item_storage_list_result_spec.rb +39 -0
- data/spec/models/content_library_item_storage_result_spec.rb +39 -0
- data/spec/models/content_library_item_transfer_endpoint_spec.rb +45 -0
- data/spec/models/content_library_item_transfer_status_spec.rb +33 -0
- data/spec/models/content_library_item_update_session_create_result_spec.rb +39 -0
- data/spec/models/content_library_item_update_session_create_spec.rb +45 -0
- data/spec/models/content_library_item_update_session_fail_spec.rb +39 -0
- data/spec/models/content_library_item_update_session_keep_alive_spec.rb +39 -0
- data/spec/models/content_library_item_update_session_list_result_spec.rb +39 -0
- data/spec/models/content_library_item_update_session_model_spec.rb +87 -0
- data/spec/models/content_library_item_update_session_model_state_spec.rb +33 -0
- data/spec/models/content_library_item_update_session_result_spec.rb +39 -0
- data/spec/models/content_library_item_update_session_update_spec.rb +39 -0
- data/spec/models/content_library_item_update_spec.rb +39 -0
- data/spec/models/content_library_item_updatesession_certificate_info_spec.rb +57 -0
- data/spec/models/content_library_item_updatesession_file_add_result_spec.rb +39 -0
- data/spec/models/content_library_item_updatesession_file_add_spec.rb +39 -0
- data/spec/models/content_library_item_updatesession_file_add_spec_spec.rb +63 -0
- data/spec/models/content_library_item_updatesession_file_get_spec.rb +39 -0
- data/spec/models/content_library_item_updatesession_file_info_spec.rb +93 -0
- data/spec/models/content_library_item_updatesession_file_list_result_spec.rb +39 -0
- data/spec/models/content_library_item_updatesession_file_remove_spec.rb +39 -0
- data/spec/models/content_library_item_updatesession_file_result_spec.rb +39 -0
- data/spec/models/content_library_item_updatesession_file_source_type_spec.rb +33 -0
- data/spec/models/content_library_item_updatesession_file_validate_result_spec.rb +39 -0
- data/spec/models/content_library_item_updatesession_file_validation_error_spec.rb +45 -0
- data/spec/models/content_library_item_updatesession_file_validation_result_spec.rb +51 -0
- data/spec/models/content_library_item_updatesession_preview_info_spec.rb +51 -0
- data/spec/models/content_library_item_updatesession_preview_info_state_spec.rb +33 -0
- data/spec/models/content_library_item_updatesession_preview_warning_info_spec.rb +51 -0
- data/spec/models/content_library_item_updatesession_warning_behavior_spec.rb +45 -0
- data/spec/models/content_library_item_updatesession_warning_type_spec.rb +33 -0
- data/spec/models/content_library_list_result_spec.rb +39 -0
- data/spec/models/content_library_model_library_type_spec.rb +33 -0
- data/spec/models/content_library_model_spec.rb +111 -0
- data/spec/models/content_library_optimization_info_spec.rb +39 -0
- data/spec/models/content_library_publish_info_authentication_method_spec.rb +33 -0
- data/spec/models/content_library_publish_info_spec.rb +75 -0
- data/spec/models/content_library_result_spec.rb +39 -0
- data/spec/models/content_library_storage_backing_spec.rb +51 -0
- data/spec/models/content_library_storage_backing_type_spec.rb +33 -0
- data/spec/models/content_library_subscribed_item_sync_spec.rb +39 -0
- data/spec/models/content_library_subscription_info_authentication_method_spec.rb +33 -0
- data/spec/models/content_library_subscription_info_spec.rb +75 -0
- data/spec/models/content_library_update_spec.rb +39 -0
- data/spec/models/content_local_library_create_result_spec.rb +39 -0
- data/spec/models/content_local_library_create_spec.rb +45 -0
- data/spec/models/content_local_library_list_result_spec.rb +39 -0
- data/spec/models/content_local_library_result_spec.rb +39 -0
- data/spec/models/content_local_library_update_spec.rb +39 -0
- data/spec/models/content_subscribed_library_create_result_spec.rb +39 -0
- data/spec/models/content_subscribed_library_create_spec.rb +45 -0
- data/spec/models/content_subscribed_library_list_result_spec.rb +39 -0
- data/spec/models/content_subscribed_library_probe_result_spec.rb +51 -0
- data/spec/models/content_subscribed_library_probe_result_status_spec.rb +33 -0
- data/spec/models/content_subscribed_library_probe_spec.rb +39 -0
- data/spec/models/content_subscribed_library_result_spec.rb +39 -0
- data/spec/models/content_subscribed_library_update_spec.rb +39 -0
- data/spec/models/vapi_std_errors_concurrent_change_error_spec.rb +45 -0
- data/spec/models/vapi_std_errors_concurrent_change_spec.rb +45 -0
- data/spec/models/vapi_std_errors_invalid_argument_error_spec.rb +45 -0
- data/spec/models/vapi_std_errors_invalid_argument_spec.rb +45 -0
- data/spec/models/vapi_std_errors_invalid_element_configuration_error_spec.rb +45 -0
- data/spec/models/vapi_std_errors_invalid_element_configuration_spec.rb +45 -0
- data/spec/models/vapi_std_errors_invalid_element_type_error_spec.rb +45 -0
- data/spec/models/vapi_std_errors_invalid_element_type_spec.rb +45 -0
- data/spec/models/vapi_std_errors_not_allowed_in_current_state_error_spec.rb +45 -0
- data/spec/models/vapi_std_errors_not_allowed_in_current_state_spec.rb +45 -0
- data/spec/models/vapi_std_errors_not_found_error_spec.rb +45 -0
- data/spec/models/vapi_std_errors_not_found_spec.rb +45 -0
- data/spec/models/vapi_std_errors_resource_busy_error_spec.rb +45 -0
- data/spec/models/vapi_std_errors_resource_busy_spec.rb +45 -0
- data/spec/models/vapi_std_errors_resource_inaccessible_error_spec.rb +45 -0
- data/spec/models/vapi_std_errors_resource_inaccessible_spec.rb +45 -0
- data/spec/models/vapi_std_errors_unauthorized_error_spec.rb +45 -0
- data/spec/models/vapi_std_errors_unauthorized_spec.rb +45 -0
- data/spec/models/vapi_std_errors_unsupported_error_spec.rb +45 -0
- data/spec/models/vapi_std_errors_unsupported_spec.rb +45 -0
- data/spec/models/vapi_std_localizable_message_spec.rb +51 -0
- data/spec/spec_helper.rb +109 -0
- data/vsphere-automation-content.gemspec +44 -0
- metadata +725 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
=begin
|
2
|
+
# DO NOT MODIFY. THIS CODE IS GENERATED. CHANGES WILL BE OVERWRITTEN.
|
3
|
+
|
4
|
+
# content
|
5
|
+
|
6
|
+
# VMware vSphere® Content Library empowers vSphere Admins to effectively manage VM templates, vApps, ISO images and scripts with ease.
|
7
|
+
|
8
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'spec_helper'
|
12
|
+
require 'json'
|
13
|
+
|
14
|
+
# Unit tests for VSphereAutomation::Content::LibrarySubscribedItemApi
|
15
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
16
|
+
# Please update as you see appropriate
|
17
|
+
describe 'LibrarySubscribedItemApi' do
|
18
|
+
before do
|
19
|
+
# run before each test
|
20
|
+
@instance = VSphereAutomation::Content::LibrarySubscribedItemApi.new
|
21
|
+
end
|
22
|
+
|
23
|
+
after do
|
24
|
+
# run after each test
|
25
|
+
end
|
26
|
+
|
27
|
+
describe 'test an instance of LibrarySubscribedItemApi' do
|
28
|
+
it 'should create an instance of LibrarySubscribedItemApi' do
|
29
|
+
expect(@instance).to be_instance_of(VSphereAutomation::Content::LibrarySubscribedItemApi)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# unit tests for evict
|
34
|
+
# Evicts the cached content of a library item in a subscribed library. <p> This {@term operation} allows the cached content of a library item to be removed to free up storage capacity. This {@term operation} will only work when a library item is synchronized on-demand. When a library is not synchronized on-demand, it always attempts to keep its cache up-to-date with the published source. Evicting the library item will set {@link ItemModel#cached} to false.
|
35
|
+
# @param library_item_id Identifier of the library item whose content should be evicted.
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @return [nil]
|
38
|
+
describe 'evict test' do
|
39
|
+
it 'should work' do
|
40
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# unit tests for sync
|
45
|
+
# Forces the synchronization of an individual library item in a subscribed library. <p> Synchronizing an individual item will update that item's metadata from the remote source. If the source library item on the remote library has been deleted, this {@term operation} will delete the library item from the subscribed library as well. <p> The default behavior of the synchronization is determined by the {@link SubscriptionInfo} of the library which owns the library item. <ul> <li>If {@link SubscriptionInfo#onDemand} is true, then the file content is not synchronized by default. In this case, only the library item metadata is synchronized. The file content may still be forcefully synchronized by passing true for the {@param.name forceSyncContent} {@term parameter}.</li> <li>If {@link SubscriptionInfo#onDemand} is false, then this call will always synchronize the file content. The {@param.name forceSyncContent} {@term parameter} is ignored when the subscription is not on-demand.</li> </ul> When the file content has been synchronized, the {@link ItemModel#cached} {@term field} will be true. <p> This {@term operation} will return immediately and create an asynchronous task to perform the synchronization.
|
46
|
+
# @param library_item_id Identifier of the library item to synchronize.
|
47
|
+
# @param content_library_subscribed_item_sync
|
48
|
+
# @param [Hash] opts the optional parameters
|
49
|
+
# @return [nil]
|
50
|
+
describe 'sync test' do
|
51
|
+
it 'should work' do
|
52
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
=begin
|
2
|
+
# DO NOT MODIFY. THIS CODE IS GENERATED. CHANGES WILL BE OVERWRITTEN.
|
3
|
+
|
4
|
+
# content
|
5
|
+
|
6
|
+
# VMware vSphere® Content Library empowers vSphere Admins to effectively manage VM templates, vApps, ISO images and scripts with ease.
|
7
|
+
|
8
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'spec_helper'
|
12
|
+
require 'json'
|
13
|
+
|
14
|
+
# Unit tests for VSphereAutomation::Content::LocalLibraryApi
|
15
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
16
|
+
# Please update as you see appropriate
|
17
|
+
describe 'LocalLibraryApi' do
|
18
|
+
before do
|
19
|
+
# run before each test
|
20
|
+
@instance = VSphereAutomation::Content::LocalLibraryApi.new
|
21
|
+
end
|
22
|
+
|
23
|
+
after do
|
24
|
+
# run after each test
|
25
|
+
end
|
26
|
+
|
27
|
+
describe 'test an instance of LocalLibraryApi' do
|
28
|
+
it 'should create an instance of LocalLibraryApi' do
|
29
|
+
expect(@instance).to be_instance_of(VSphereAutomation::Content::LocalLibraryApi)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# unit tests for create
|
34
|
+
# Creates a new local library.
|
35
|
+
# @param content_local_library_create
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @return [ContentLocalLibraryCreateResult]
|
38
|
+
describe 'create test' do
|
39
|
+
it 'should work' do
|
40
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# unit tests for delete
|
45
|
+
# Deletes the specified local library. <p> Deleting a local library will remove the entry immediately and begin an asynchronous task to remove all cached content for the library. If the asynchronous task fails, file content may remain on the storage backing. This content will require manual removal.
|
46
|
+
# @param library_id Identifier of the local library to delete.
|
47
|
+
# @param [Hash] opts the optional parameters
|
48
|
+
# @return [nil]
|
49
|
+
describe 'delete test' do
|
50
|
+
it 'should work' do
|
51
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# unit tests for get
|
56
|
+
# Returns a given local library.
|
57
|
+
# @param library_id Identifier of the local library to return.
|
58
|
+
# @param [Hash] opts the optional parameters
|
59
|
+
# @return [ContentLocalLibraryResult]
|
60
|
+
describe 'get test' do
|
61
|
+
it 'should work' do
|
62
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# unit tests for list
|
67
|
+
# Returns the identifiers of all local libraries in the Content Library.
|
68
|
+
# @param [Hash] opts the optional parameters
|
69
|
+
# @return [ContentLocalLibraryListResult]
|
70
|
+
describe 'list test' do
|
71
|
+
it 'should work' do
|
72
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# unit tests for update
|
77
|
+
# Updates the properties of a local library. <p> This is an incremental update to the local library. {@term Fields} that are {@term unset} in the update specification will be left unchanged.
|
78
|
+
# @param library_id Identifier of the local library to update.
|
79
|
+
# @param content_local_library_update
|
80
|
+
# @param [Hash] opts the optional parameters
|
81
|
+
# @return [nil]
|
82
|
+
describe 'update test' do
|
83
|
+
it 'should work' do
|
84
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
=begin
|
2
|
+
# DO NOT MODIFY. THIS CODE IS GENERATED. CHANGES WILL BE OVERWRITTEN.
|
3
|
+
|
4
|
+
# content
|
5
|
+
|
6
|
+
# VMware vSphere® Content Library empowers vSphere Admins to effectively manage VM templates, vApps, ISO images and scripts with ease.
|
7
|
+
|
8
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'spec_helper'
|
12
|
+
require 'json'
|
13
|
+
|
14
|
+
# Unit tests for VSphereAutomation::Content::SubscribedLibraryApi
|
15
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
16
|
+
# Please update as you see appropriate
|
17
|
+
describe 'SubscribedLibraryApi' do
|
18
|
+
before do
|
19
|
+
# run before each test
|
20
|
+
@instance = VSphereAutomation::Content::SubscribedLibraryApi.new
|
21
|
+
end
|
22
|
+
|
23
|
+
after do
|
24
|
+
# run after each test
|
25
|
+
end
|
26
|
+
|
27
|
+
describe 'test an instance of SubscribedLibraryApi' do
|
28
|
+
it 'should create an instance of SubscribedLibraryApi' do
|
29
|
+
expect(@instance).to be_instance_of(VSphereAutomation::Content::SubscribedLibraryApi)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# unit tests for create
|
34
|
+
# Creates a new subscribed library. <p> Once created, the subscribed library will be empty. If the {@link LibraryModel#subscriptionInfo} property is set, the Content Library Service will attempt to synchronize to the remote source. This is an asynchronous operation so the content of the published library may not immediately appear.
|
35
|
+
# @param content_subscribed_library_create
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @return [ContentSubscribedLibraryCreateResult]
|
38
|
+
describe 'create test' do
|
39
|
+
it 'should work' do
|
40
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# unit tests for delete
|
45
|
+
# Deletes the specified subscribed library. <p> Deleting a subscribed library will remove the entry immediately and begin an asynchronous task to remove all cached content for the library. If the asynchronous task fails, file content may remain on the storage backing. This content will require manual removal.
|
46
|
+
# @param library_id Identifier of the subscribed library to delete.
|
47
|
+
# @param [Hash] opts the optional parameters
|
48
|
+
# @return [nil]
|
49
|
+
describe 'delete test' do
|
50
|
+
it 'should work' do
|
51
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# unit tests for evict
|
56
|
+
# Evicts the cached content of an on-demand subscribed library. <p> This {@term operation} allows the cached content of a subscribed library to be removed to free up storage capacity. This {@term operation} will only work when a subscribed library is synchronized on-demand.
|
57
|
+
# @param library_id Identifier of the subscribed library whose content should be evicted.
|
58
|
+
# @param [Hash] opts the optional parameters
|
59
|
+
# @return [nil]
|
60
|
+
describe 'evict test' do
|
61
|
+
it 'should work' do
|
62
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# unit tests for get
|
67
|
+
# Returns a given subscribed library.
|
68
|
+
# @param library_id Identifier of the subscribed library to return.
|
69
|
+
# @param [Hash] opts the optional parameters
|
70
|
+
# @return [ContentSubscribedLibraryResult]
|
71
|
+
describe 'get test' do
|
72
|
+
it 'should work' do
|
73
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# unit tests for list
|
78
|
+
# Returns the identifiers of all subscribed libraries in the Content Library.
|
79
|
+
# @param [Hash] opts the optional parameters
|
80
|
+
# @return [ContentSubscribedLibraryListResult]
|
81
|
+
describe 'list test' do
|
82
|
+
it 'should work' do
|
83
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# unit tests for probe
|
88
|
+
# Probes remote library subscription information, including URL, SSL certificate and password. The resulting {@link ProbeResult} {@term structure} describes whether or not the subscription configuration is successful.
|
89
|
+
# @param content_subscribed_library_probe
|
90
|
+
# @param [Hash] opts the optional parameters
|
91
|
+
# @return [ContentSubscribedLibraryProbeResult]
|
92
|
+
describe 'probe test' do
|
93
|
+
it 'should work' do
|
94
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# unit tests for sync
|
99
|
+
# Forces the synchronization of the subscribed library. <p> Synchronizing a subscribed library forcefully with this {@term operation} will perform the same synchronization behavior as would run periodically for the library. The {@link SubscriptionInfo#onDemand} setting is respected. Calling this {@term operation} on a library that is already in the process of synchronizing will have no effect.
|
100
|
+
# @param library_id Identifier of the subscribed library to synchronize.
|
101
|
+
# @param [Hash] opts the optional parameters
|
102
|
+
# @return [nil]
|
103
|
+
describe 'sync test' do
|
104
|
+
it 'should work' do
|
105
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# unit tests for update
|
110
|
+
# Updates the properties of a subscribed library. <p> This is an incremental update to the subscribed library. {@term Fields} that are {@term unset} in the update specification will be left unchanged.
|
111
|
+
# @param library_id Identifier of the subscribed library to update.
|
112
|
+
# @param content_subscribed_library_update
|
113
|
+
# @param [Hash] opts the optional parameters
|
114
|
+
# @return [nil]
|
115
|
+
describe 'update test' do
|
116
|
+
it 'should work' do
|
117
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
@@ -0,0 +1,224 @@
|
|
1
|
+
=begin
|
2
|
+
# DO NOT MODIFY. THIS CODE IS GENERATED. CHANGES WILL BE OVERWRITTEN.
|
3
|
+
|
4
|
+
# content
|
5
|
+
|
6
|
+
# VMware vSphere® Content Library empowers vSphere Admins to effectively manage VM templates, vApps, ISO images and scripts with ease.
|
7
|
+
|
8
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'spec_helper'
|
12
|
+
|
13
|
+
describe VSphereAutomation::ApiClient do
|
14
|
+
context 'initialization' do
|
15
|
+
context 'URL stuff' do
|
16
|
+
context 'host' do
|
17
|
+
it 'removes http from host' do
|
18
|
+
VSphereAutomation.configure { |c| c.host = 'http://example.com' }
|
19
|
+
expect(VSphereAutomation::Configuration.default.host).to eq('example.com')
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'removes https from host' do
|
23
|
+
VSphereAutomation.configure { |c| c.host = 'https://wookiee.com' }
|
24
|
+
expect(VSphereAutomation::ApiClient.default.config.host).to eq('wookiee.com')
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'removes trailing path from host' do
|
28
|
+
VSphereAutomation.configure { |c| c.host = 'hobo.com/v4' }
|
29
|
+
expect(VSphereAutomation::Configuration.default.host).to eq('hobo.com')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context 'base_path' do
|
34
|
+
it "prepends a slash to base_path" do
|
35
|
+
VSphereAutomation.configure { |c| c.base_path = 'v4/dog' }
|
36
|
+
expect(VSphereAutomation::Configuration.default.base_path).to eq('/v4/dog')
|
37
|
+
end
|
38
|
+
|
39
|
+
it "doesn't prepend a slash if one is already there" do
|
40
|
+
VSphereAutomation.configure { |c| c.base_path = '/v4/dog' }
|
41
|
+
expect(VSphereAutomation::Configuration.default.base_path).to eq('/v4/dog')
|
42
|
+
end
|
43
|
+
|
44
|
+
it "ends up as a blank string if nil" do
|
45
|
+
VSphereAutomation.configure { |c| c.base_path = nil }
|
46
|
+
expect(VSphereAutomation::Configuration.default.base_path).to eq('')
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe 'params_encoding in #build_request' do
|
53
|
+
let(:config) { VSphereAutomation::Configuration.new }
|
54
|
+
let(:api_client) { VSphereAutomation::ApiClient.new(config) }
|
55
|
+
|
56
|
+
it 'defaults to nil' do
|
57
|
+
expect(VSphereAutomation::Configuration.default.params_encoding).to eq(nil)
|
58
|
+
expect(config.params_encoding).to eq(nil)
|
59
|
+
|
60
|
+
request = api_client.build_request(:get, '/test')
|
61
|
+
expect(request.options[:params_encoding]).to eq(nil)
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'can be customized' do
|
65
|
+
config.params_encoding = :multi
|
66
|
+
request = api_client.build_request(:get, '/test')
|
67
|
+
expect(request.options[:params_encoding]).to eq(:multi)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe 'timeout in #build_request' do
|
72
|
+
let(:config) { VSphereAutomation::Configuration.new }
|
73
|
+
let(:api_client) { VSphereAutomation::ApiClient.new(config) }
|
74
|
+
|
75
|
+
it 'defaults to 0' do
|
76
|
+
expect(VSphereAutomation::Configuration.default.timeout).to eq(0)
|
77
|
+
expect(config.timeout).to eq(0)
|
78
|
+
|
79
|
+
request = api_client.build_request(:get, '/test')
|
80
|
+
expect(request.options[:timeout]).to eq(0)
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'can be customized' do
|
84
|
+
config.timeout = 100
|
85
|
+
request = api_client.build_request(:get, '/test')
|
86
|
+
expect(request.options[:timeout]).to eq(100)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe '#deserialize' do
|
91
|
+
it "handles Array<Integer>" do
|
92
|
+
api_client = VSphereAutomation::ApiClient.new
|
93
|
+
headers = { 'Content-Type' => 'application/json' }
|
94
|
+
response = double('response', headers: headers, body: '[12, 34]')
|
95
|
+
data = api_client.deserialize(response, 'Array<Integer>')
|
96
|
+
expect(data).to be_instance_of(Array)
|
97
|
+
expect(data).to eq([12, 34])
|
98
|
+
end
|
99
|
+
|
100
|
+
it 'handles Array<Array<Integer>>' do
|
101
|
+
api_client = VSphereAutomation::ApiClient.new
|
102
|
+
headers = { 'Content-Type' => 'application/json' }
|
103
|
+
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
104
|
+
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
105
|
+
expect(data).to be_instance_of(Array)
|
106
|
+
expect(data).to eq([[12, 34], [56]])
|
107
|
+
end
|
108
|
+
|
109
|
+
it 'handles Hash<String, String>' do
|
110
|
+
api_client = VSphereAutomation::ApiClient.new
|
111
|
+
headers = { 'Content-Type' => 'application/json' }
|
112
|
+
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
113
|
+
data = api_client.deserialize(response, 'Hash<String, String>')
|
114
|
+
expect(data).to be_instance_of(Hash)
|
115
|
+
expect(data).to eq(:message => 'Hello')
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
describe "#object_to_hash" do
|
120
|
+
it 'ignores nils and includes empty arrays' do
|
121
|
+
# uncomment below to test object_to_hash for model
|
122
|
+
# api_client = VSphereAutomation::ApiClient.new
|
123
|
+
# _model = VSphereAutomation::ModelName.new
|
124
|
+
# update the model attribute below
|
125
|
+
# _model.id = 1
|
126
|
+
# update the expected value (hash) below
|
127
|
+
# expected = {id: 1, name: '', tags: []}
|
128
|
+
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
describe '#build_collection_param' do
|
133
|
+
let(:param) { ['aa', 'bb', 'cc'] }
|
134
|
+
let(:api_client) { VSphereAutomation::ApiClient.new }
|
135
|
+
|
136
|
+
it 'works for csv' do
|
137
|
+
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
138
|
+
end
|
139
|
+
|
140
|
+
it 'works for ssv' do
|
141
|
+
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
142
|
+
end
|
143
|
+
|
144
|
+
it 'works for tsv' do
|
145
|
+
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
146
|
+
end
|
147
|
+
|
148
|
+
it 'works for pipes' do
|
149
|
+
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
150
|
+
end
|
151
|
+
|
152
|
+
it 'works for multi' do
|
153
|
+
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
154
|
+
end
|
155
|
+
|
156
|
+
it 'fails for invalid collection format' do
|
157
|
+
expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
describe '#json_mime?' do
|
162
|
+
let(:api_client) { VSphereAutomation::ApiClient.new }
|
163
|
+
|
164
|
+
it 'works' do
|
165
|
+
expect(api_client.json_mime?(nil)).to eq false
|
166
|
+
expect(api_client.json_mime?('')).to eq false
|
167
|
+
|
168
|
+
expect(api_client.json_mime?('application/json')).to eq true
|
169
|
+
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
170
|
+
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
171
|
+
|
172
|
+
expect(api_client.json_mime?('application/xml')).to eq false
|
173
|
+
expect(api_client.json_mime?('text/plain')).to eq false
|
174
|
+
expect(api_client.json_mime?('application/jsonp')).to eq false
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
describe '#select_header_accept' do
|
179
|
+
let(:api_client) { VSphereAutomation::ApiClient.new }
|
180
|
+
|
181
|
+
it 'works' do
|
182
|
+
expect(api_client.select_header_accept(nil)).to be_nil
|
183
|
+
expect(api_client.select_header_accept([])).to be_nil
|
184
|
+
|
185
|
+
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
186
|
+
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
187
|
+
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
188
|
+
|
189
|
+
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
190
|
+
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
describe '#select_header_content_type' do
|
195
|
+
let(:api_client) { VSphereAutomation::ApiClient.new }
|
196
|
+
|
197
|
+
it 'works' do
|
198
|
+
expect(api_client.select_header_content_type(nil)).to eq('application/json')
|
199
|
+
expect(api_client.select_header_content_type([])).to eq('application/json')
|
200
|
+
|
201
|
+
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
202
|
+
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
203
|
+
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
204
|
+
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
205
|
+
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
describe '#sanitize_filename' do
|
210
|
+
let(:api_client) { VSphereAutomation::ApiClient.new }
|
211
|
+
|
212
|
+
it 'works' do
|
213
|
+
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
214
|
+
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
215
|
+
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
216
|
+
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
217
|
+
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
218
|
+
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
219
|
+
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
220
|
+
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
221
|
+
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|