comet_backup_ruby_sdk 1.11.0 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (345) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -2
  3. data/Gemfile.lock +1 -1
  4. data/README.md +3 -2
  5. data/RELEASING.md +1 -1
  6. data/comet_backup_ruby_sdk.gemspec +1 -1
  7. data/lib/api_response_error.rb +27 -0
  8. data/lib/comet/api_response_error.rb +1 -1
  9. data/lib/comet/comet_server.rb +85 -6
  10. data/lib/comet/definitions.rb +72 -14
  11. data/lib/comet/models/add_bucket_response_message.rb +1 -1
  12. data/lib/comet/models/admin_account_properties_response.rb +1 -1
  13. data/lib/comet/models/admin_email_options.rb +1 -1
  14. data/lib/comet/models/admin_resource_response.rb +1 -1
  15. data/lib/comet/models/admin_security_options.rb +3 -1
  16. data/lib/comet/models/admin_u2fregistration.rb +2 -1
  17. data/lib/comet/models/admin_user_permissions.rb +1 -1
  18. data/lib/comet/models/admin_web_authn_registration.rb +10 -1
  19. data/lib/comet/models/allowed_admin_user.rb +3 -1
  20. data/lib/comet/models/available_download.rb +1 -1
  21. data/lib/comet/models/azure_destination_location.rb +1 -1
  22. data/lib/comet/models/b2destination_location.rb +2 -1
  23. data/lib/comet/models/b2storage_extra_info.rb +1 -1
  24. data/lib/comet/models/b2transaction_totals.rb +1 -1
  25. data/lib/comet/models/b2virtual_storage_role_settings.rb +1 -1
  26. data/lib/comet/models/backup_job_advanced_options.rb +10 -1
  27. data/lib/comet/models/backup_job_detail.rb +54 -1
  28. data/lib/comet/models/backup_job_progress.rb +1 -1
  29. data/lib/comet/models/backup_rule_config.rb +10 -1
  30. data/lib/comet/models/backup_rule_event_triggers.rb +1 -1
  31. data/lib/comet/models/branding_options.rb +10 -1
  32. data/lib/comet/models/branding_properties.rb +10 -1
  33. data/lib/comet/models/browse_disk_drives_response.rb +1 -1
  34. data/lib/comet/models/browse_edbresponse.rb +1 -1
  35. data/lib/comet/models/browse_hvresponse.rb +1 -1
  36. data/lib/comet/models/browse_office_365list_virtual_accounts_response.rb +1 -1
  37. data/lib/comet/models/browse_office_365objects_response.rb +1 -1
  38. data/lib/comet/models/browse_sqlserver_response.rb +1 -1
  39. data/lib/comet/models/browse_vssresponse.rb +1 -1
  40. data/lib/comet/models/bucket_properties.rb +1 -1
  41. data/lib/comet/models/bucket_usage_info.rb +1 -1
  42. data/lib/comet/models/comet_apiresponse_message.rb +1 -1
  43. data/lib/comet/models/comet_destination_location.rb +1 -1
  44. data/lib/comet/models/constellation_check_report.rb +1 -1
  45. data/lib/comet/models/constellation_stats.rb +1 -1
  46. data/lib/comet/models/constellation_status_apiresponse.rb +1 -1
  47. data/lib/comet/models/content_measurement.rb +1 -1
  48. data/lib/comet/models/content_measurement_component.rb +1 -1
  49. data/lib/comet/models/create_group_policy_response.rb +1 -1
  50. data/lib/comet/models/custom_remote_bucket_settings.rb +1 -1
  51. data/lib/comet/models/days_of_week_config.rb +108 -0
  52. data/lib/comet/models/default_email_report_policy.rb +1 -1
  53. data/lib/comet/models/default_source_with_osrestriction.rb +1 -1
  54. data/lib/comet/models/destination_config.rb +1 -1
  55. data/lib/comet/models/destination_location.rb +1 -1
  56. data/lib/comet/models/destination_statistics.rb +1 -1
  57. data/lib/comet/models/device_config.rb +1 -1
  58. data/lib/comet/models/disk_drive.rb +1 -1
  59. data/lib/comet/models/dispatcher_admin_sources_response.rb +1 -1
  60. data/lib/comet/models/dispatcher_stored_objects_response.rb +1 -1
  61. data/lib/comet/models/dispatcher_vault_snapshots_response.rb +1 -1
  62. data/lib/comet/models/dispatcher_windisk_snapshot_response.rb +1 -1
  63. data/lib/comet/models/edbfile_info.rb +1 -1
  64. data/lib/comet/models/email_options.rb +1 -1
  65. data/lib/comet/models/email_report_config.rb +1 -1
  66. data/lib/comet/models/email_report_generated_preview.rb +1 -1
  67. data/lib/comet/models/external_ldapauthentication_source_settings.rb +1 -1
  68. data/lib/comet/models/extra_file_exclusion.rb +1 -1
  69. data/lib/comet/models/ftpdestination_location.rb +1 -1
  70. data/lib/comet/models/get_group_policy_response.rb +1 -1
  71. data/lib/comet/models/get_profile_and_hash_response_message.rb +1 -1
  72. data/lib/comet/models/get_profile_hash_response_message.rb +1 -1
  73. data/lib/comet/models/group_policy.rb +1 -1
  74. data/lib/comet/models/hour_sched_config.rb +84 -0
  75. data/lib/comet/models/hyper_vmachine_info.rb +1 -1
  76. data/lib/comet/models/install_creds.rb +1 -1
  77. data/lib/comet/models/install_token.rb +1 -1
  78. data/lib/comet/models/install_token_response.rb +1 -1
  79. data/lib/comet/models/job_entry.rb +2 -1
  80. data/lib/comet/models/live_user_connection.rb +1 -1
  81. data/lib/comet/models/local_destination_location.rb +1 -1
  82. data/lib/comet/models/mac_oscode_sign_properties.rb +70 -1
  83. data/lib/comet/models/mongo_dbconnection.rb +1 -1
  84. data/lib/comet/models/mssqlconnection.rb +1 -1
  85. data/lib/comet/models/my_sqlconnection.rb +1 -1
  86. data/lib/comet/models/new_bucket_detail.rb +1 -1
  87. data/lib/comet/models/news_entry.rb +1 -1
  88. data/lib/comet/models/office_365connection.rb +1 -1
  89. data/lib/comet/models/office_365credential.rb +1 -1
  90. data/lib/comet/models/office_365custom_setting.rb +2 -1
  91. data/lib/comet/models/office_365custom_setting_v2.rb +1 -1
  92. data/lib/comet/models/office_365mixed_virtual_account.rb +9 -1
  93. data/lib/comet/models/office_365object_info.rb +1 -1
  94. data/lib/comet/models/organization.rb +1 -1
  95. data/lib/comet/models/organization_response.rb +1 -1
  96. data/lib/comet/models/osinfo.rb +1 -1
  97. data/lib/comet/models/partition.rb +1 -1
  98. data/lib/comet/models/private_branding_properties.rb +10 -1
  99. data/lib/comet/models/protected_item_engine_type_policy.rb +1 -1
  100. data/lib/comet/models/public_branding_properties.rb +1 -1
  101. data/lib/comet/models/register_office_application_begin_response.rb +1 -1
  102. data/lib/comet/models/register_office_application_check_response.rb +1 -1
  103. data/lib/comet/models/remote_server_address.rb +1 -1
  104. data/lib/comet/models/remote_storage_option.rb +1 -1
  105. data/lib/comet/models/replicator_state_apiresponse.rb +1 -1
  106. data/lib/comet/models/request_storage_vault_response_message.rb +1 -1
  107. data/lib/comet/models/restore_job_advanced_options.rb +1 -1
  108. data/lib/comet/models/retention_policy.rb +1 -1
  109. data/lib/comet/models/retention_range.rb +1 -1
  110. data/lib/comet/models/s3destination_location.rb +1 -1
  111. data/lib/comet/models/schedule_config.rb +37 -1
  112. data/lib/comet/models/search_clause.rb +1 -1
  113. data/lib/comet/models/self_backup_statistics.rb +1 -1
  114. data/lib/comet/models/server_config_options_branding_fragment.rb +1 -1
  115. data/lib/comet/models/server_config_options_software_build_role_fragment.rb +1 -1
  116. data/lib/comet/models/server_meta_branding_properties.rb +1 -1
  117. data/lib/comet/models/server_meta_version_info.rb +1 -1
  118. data/lib/comet/models/session_key_regenerated_response.rb +1 -1
  119. data/lib/comet/models/sftpdestination_location.rb +1 -1
  120. data/lib/comet/models/size_measurement.rb +1 -1
  121. data/lib/comet/models/software_build_role_options.rb +1 -1
  122. data/lib/comet/models/software_update_news_response.rb +1 -1
  123. data/lib/comet/models/source_basic_info.rb +1 -1
  124. data/lib/comet/models/source_config.rb +1 -1
  125. data/lib/comet/models/source_include_pattern.rb +1 -1
  126. data/lib/comet/models/source_statistics.rb +1 -1
  127. data/lib/comet/models/spanned_destination_location.rb +1 -1
  128. data/lib/comet/models/spanned_storage_extra_info.rb +1 -1
  129. data/lib/comet/models/sshconnection.rb +1 -1
  130. data/lib/comet/models/stat_result.rb +1 -1
  131. data/lib/comet/models/storage_free_space_info.rb +1 -1
  132. data/lib/comet/models/storage_vault_provider_policy.rb +1 -1
  133. data/lib/comet/models/stored_object.rb +2 -1
  134. data/lib/comet/models/streamable_event.rb +1 -1
  135. data/lib/comet/models/swift_destination_location.rb +1 -1
  136. data/lib/comet/models/test_response.rb +1 -1
  137. data/lib/comet/models/totp_regenerated_response.rb +1 -1
  138. data/lib/comet/models/u2fregister_request.rb +2 -1
  139. data/lib/comet/models/u2fregistered_key.rb +2 -1
  140. data/lib/comet/models/u2fregistration_challenge_response.rb +2 -1
  141. data/lib/comet/models/u2fsign_request.rb +2 -1
  142. data/lib/comet/models/u2fsign_response.rb +2 -1
  143. data/lib/comet/models/uninstall_config.rb +1 -1
  144. data/lib/comet/models/update_campaign_device_status.rb +1 -1
  145. data/lib/comet/models/update_campaign_options.rb +24 -1
  146. data/lib/comet/models/update_campaign_properties.rb +21 -1
  147. data/lib/comet/models/update_campaign_status.rb +21 -1
  148. data/lib/comet/models/update_campaign_status_device_entry.rb +1 -1
  149. data/lib/comet/models/user_custom_email_settings.rb +1 -1
  150. data/lib/comet/models/user_on_server.rb +1 -1
  151. data/lib/comet/models/user_policy.rb +1 -1
  152. data/lib/comet/models/user_profile_config.rb +10 -1
  153. data/lib/comet/models/user_profile_fragment.rb +1 -1
  154. data/lib/comet/models/vault_snapshot.rb +1 -1
  155. data/lib/comet/models/vmdksnapshot_view_options.rb +90 -0
  156. data/lib/comet/models/vsscomponent.rb +1 -1
  157. data/lib/comet/models/vsswriter_info.rb +1 -1
  158. data/lib/comet/models/wasabi_virtual_storage_role_settings.rb +1 -1
  159. data/lib/comet/models/web_authn_authenticator_selection.rb +1 -1
  160. data/lib/comet/models/web_authn_credential.rb +1 -1
  161. data/lib/comet/models/web_authn_credential_assertion.rb +1 -1
  162. data/lib/comet/models/web_authn_credential_descriptor.rb +1 -1
  163. data/lib/comet/models/web_authn_credential_entity.rb +1 -1
  164. data/lib/comet/models/web_authn_credential_parameter.rb +1 -1
  165. data/lib/comet/models/web_authn_public_key_credential_creation_options.rb +3 -4
  166. data/lib/comet/models/web_authn_public_key_credential_request_options.rb +3 -4
  167. data/lib/comet/models/web_authn_registration_challenge_response.rb +1 -1
  168. data/lib/comet/models/web_authn_relying_party_entity.rb +1 -1
  169. data/lib/comet/models/web_authn_sign_request.rb +1 -1
  170. data/lib/comet/models/web_authn_sign_response.rb +1 -1
  171. data/lib/comet/models/web_authn_user_entity.rb +1 -1
  172. data/lib/comet/models/web_interface_branding_properties.rb +1 -1
  173. data/lib/comet/models/webhook_option.rb +1 -1
  174. data/lib/comet/models/win_smbauth.rb +1 -1
  175. data/lib/comet/models/windows_code_sign_properties.rb +1 -1
  176. data/lib/comet_backup_ruby_sdk.rb +4 -1
  177. data/lib/comet_server.rb +3785 -0
  178. data/lib/definitions.rb +710 -0
  179. data/lib/models/add_bucket_response_message.rb +102 -0
  180. data/lib/models/admin_account_properties_response.rb +91 -0
  181. data/lib/models/admin_email_options.rb +84 -0
  182. data/lib/models/admin_resource_response.rb +93 -0
  183. data/lib/models/admin_security_options.rb +177 -0
  184. data/lib/models/admin_u2fregistration.rb +93 -0
  185. data/lib/models/admin_user_permissions.rb +106 -0
  186. data/lib/models/admin_web_authn_registration.rb +121 -0
  187. data/lib/models/allowed_admin_user.rb +214 -0
  188. data/lib/models/available_download.rb +90 -0
  189. data/lib/models/azure_destination_location.rb +111 -0
  190. data/lib/models/b2destination_location.rb +130 -0
  191. data/lib/models/b2storage_extra_info.rb +81 -0
  192. data/lib/models/b2transaction_totals.rb +93 -0
  193. data/lib/models/b2virtual_storage_role_settings.rb +99 -0
  194. data/lib/models/backup_job_advanced_options.rb +117 -0
  195. data/lib/models/backup_job_detail.rb +328 -0
  196. data/lib/models/backup_job_progress.rb +111 -0
  197. data/lib/models/backup_rule_config.rb +233 -0
  198. data/lib/models/backup_rule_event_triggers.rb +82 -0
  199. data/lib/models/branding_options.rb +335 -0
  200. data/lib/models/branding_properties.rb +293 -0
  201. data/lib/models/browse_disk_drives_response.rb +99 -0
  202. data/lib/models/browse_edbresponse.rb +99 -0
  203. data/lib/models/browse_hvresponse.rb +99 -0
  204. data/lib/models/browse_office_365list_virtual_accounts_response.rb +99 -0
  205. data/lib/models/browse_office_365objects_response.rb +99 -0
  206. data/lib/models/browse_sqlserver_response.rb +100 -0
  207. data/lib/models/browse_vssresponse.rb +99 -0
  208. data/lib/models/bucket_properties.rb +110 -0
  209. data/lib/models/bucket_usage_info.rb +97 -0
  210. data/lib/models/comet_apiresponse_message.rb +84 -0
  211. data/lib/models/comet_destination_location.rb +93 -0
  212. data/lib/models/constellation_check_report.rb +99 -0
  213. data/lib/models/constellation_stats.rb +102 -0
  214. data/lib/models/constellation_status_apiresponse.rb +114 -0
  215. data/lib/models/content_measurement.rb +99 -0
  216. data/lib/models/content_measurement_component.rb +91 -0
  217. data/lib/models/create_group_policy_response.rb +93 -0
  218. data/lib/models/custom_remote_bucket_settings.rb +75 -0
  219. data/lib/models/days_of_week_config.rb +108 -0
  220. data/lib/models/default_email_report_policy.rb +87 -0
  221. data/lib/models/default_source_with_osrestriction.rb +83 -0
  222. data/lib/models/destination_config.rb +562 -0
  223. data/lib/models/destination_location.rb +421 -0
  224. data/lib/models/destination_statistics.rb +115 -0
  225. data/lib/models/device_config.rb +124 -0
  226. data/lib/models/disk_drive.rb +180 -0
  227. data/lib/models/dispatcher_admin_sources_response.rb +100 -0
  228. data/lib/models/dispatcher_stored_objects_response.rb +99 -0
  229. data/lib/models/dispatcher_vault_snapshots_response.rb +99 -0
  230. data/lib/models/dispatcher_windisk_snapshot_response.rb +99 -0
  231. data/lib/models/edbfile_info.rb +99 -0
  232. data/lib/models/email_options.rb +153 -0
  233. data/lib/models/email_report_config.rb +98 -0
  234. data/lib/models/email_report_generated_preview.rb +136 -0
  235. data/lib/models/external_ldapauthentication_source_settings.rb +135 -0
  236. data/lib/models/extra_file_exclusion.rb +90 -0
  237. data/lib/models/ftpdestination_location.rb +141 -0
  238. data/lib/models/get_group_policy_response.rb +101 -0
  239. data/lib/models/get_profile_and_hash_response_message.rb +101 -0
  240. data/lib/models/get_profile_hash_response_message.rb +93 -0
  241. data/lib/models/group_policy.rb +98 -0
  242. data/lib/models/hour_sched_config.rb +84 -0
  243. data/lib/models/hyper_vmachine_info.rb +84 -0
  244. data/lib/models/install_creds.rb +99 -0
  245. data/lib/models/install_token.rb +117 -0
  246. data/lib/models/install_token_response.rb +92 -0
  247. data/lib/models/job_entry.rb +94 -0
  248. data/lib/models/live_user_connection.rb +149 -0
  249. data/lib/models/local_destination_location.rb +102 -0
  250. data/lib/models/mac_oscode_sign_properties.rb +197 -0
  251. data/lib/models/mongo_dbconnection.rb +230 -0
  252. data/lib/models/mssqlconnection.rb +120 -0
  253. data/lib/models/my_sqlconnection.rb +141 -0
  254. data/lib/models/new_bucket_detail.rb +84 -0
  255. data/lib/models/news_entry.rb +93 -0
  256. data/lib/models/office_365connection.rb +131 -0
  257. data/lib/models/office_365credential.rb +111 -0
  258. data/lib/models/office_365custom_setting.rb +133 -0
  259. data/lib/models/office_365custom_setting_v2.rb +108 -0
  260. data/lib/models/office_365mixed_virtual_account.rb +211 -0
  261. data/lib/models/office_365object_info.rb +118 -0
  262. data/lib/models/organization.rb +151 -0
  263. data/lib/models/organization_response.rb +101 -0
  264. data/lib/models/osinfo.rb +99 -0
  265. data/lib/models/partition.rb +172 -0
  266. data/lib/models/private_branding_properties.rb +227 -0
  267. data/lib/models/protected_item_engine_type_policy.rb +88 -0
  268. data/lib/models/public_branding_properties.rb +132 -0
  269. data/lib/models/register_office_application_begin_response.rb +93 -0
  270. data/lib/models/register_office_application_check_response.rb +100 -0
  271. data/lib/models/remote_server_address.rb +167 -0
  272. data/lib/models/remote_storage_option.rb +188 -0
  273. data/lib/models/replicator_state_apiresponse.rb +174 -0
  274. data/lib/models/request_storage_vault_response_message.rb +93 -0
  275. data/lib/models/restore_job_advanced_options.rb +131 -0
  276. data/lib/models/retention_policy.rb +90 -0
  277. data/lib/models/retention_range.rb +138 -0
  278. data/lib/models/s3destination_location.rb +123 -0
  279. data/lib/models/s3generic_virtual_storage_role.rb +111 -0
  280. data/lib/models/schedule_config.rb +131 -0
  281. data/lib/models/search_clause.rb +119 -0
  282. data/lib/models/self_backup_statistics.rb +108 -0
  283. data/lib/models/server_config_options_branding_fragment.rb +74 -0
  284. data/lib/models/server_config_options_software_build_role_fragment.rb +74 -0
  285. data/lib/models/server_meta_branding_properties.rb +144 -0
  286. data/lib/models/server_meta_version_info.rb +261 -0
  287. data/lib/models/session_key_regenerated_response.rb +102 -0
  288. data/lib/models/sftpdestination_location.rb +135 -0
  289. data/lib/models/size_measurement.rb +93 -0
  290. data/lib/models/software_build_role_options.rb +78 -0
  291. data/lib/models/software_update_news_response.rb +109 -0
  292. data/lib/models/source_basic_info.rb +101 -0
  293. data/lib/models/source_config.rb +202 -0
  294. data/lib/models/source_include_pattern.rb +84 -0
  295. data/lib/models/source_statistics.rb +82 -0
  296. data/lib/models/spanned_destination_location.rb +87 -0
  297. data/lib/models/spanned_storage_extra_info.rb +81 -0
  298. data/lib/models/sshconnection.rb +126 -0
  299. data/lib/models/stat_result.rb +111 -0
  300. data/lib/models/storage_free_space_info.rb +110 -0
  301. data/lib/models/storage_vault_provider_policy.rb +88 -0
  302. data/lib/models/stored_object.rb +238 -0
  303. data/lib/models/streamable_event.rb +92 -0
  304. data/lib/models/swift_destination_location.rb +209 -0
  305. data/lib/models/test_response.rb +90 -0
  306. data/lib/models/totp_regenerated_response.rb +111 -0
  307. data/lib/models/u2fregister_request.rb +85 -0
  308. data/lib/models/u2fregistered_key.rb +94 -0
  309. data/lib/models/u2fregistration_challenge_response.rb +133 -0
  310. data/lib/models/u2fsign_request.rb +109 -0
  311. data/lib/models/u2fsign_response.rb +103 -0
  312. data/lib/models/uninstall_config.rb +78 -0
  313. data/lib/models/update_campaign_device_status.rb +75 -0
  314. data/lib/models/update_campaign_options.rb +113 -0
  315. data/lib/models/update_campaign_properties.rb +128 -0
  316. data/lib/models/update_campaign_status.rb +143 -0
  317. data/lib/models/update_campaign_status_device_entry.rb +93 -0
  318. data/lib/models/user_custom_email_settings.rb +81 -0
  319. data/lib/models/user_on_server.rb +84 -0
  320. data/lib/models/user_policy.rb +339 -0
  321. data/lib/models/user_profile_config.rb +349 -0
  322. data/lib/models/user_profile_fragment.rb +75 -0
  323. data/lib/models/vault_snapshot.rb +99 -0
  324. data/lib/models/vmdksnapshot_view_options.rb +90 -0
  325. data/lib/models/vsscomponent.rb +99 -0
  326. data/lib/models/vsswriter_info.rb +90 -0
  327. data/lib/models/wasabi_virtual_storage_role_settings.rb +93 -0
  328. data/lib/models/web_authn_authenticator_selection.rb +96 -0
  329. data/lib/models/web_authn_credential.rb +105 -0
  330. data/lib/models/web_authn_credential_assertion.rb +74 -0
  331. data/lib/models/web_authn_credential_descriptor.rb +101 -0
  332. data/lib/models/web_authn_credential_entity.rb +86 -0
  333. data/lib/models/web_authn_credential_parameter.rb +84 -0
  334. data/lib/models/web_authn_public_key_credential_creation_options.rb +172 -0
  335. data/lib/models/web_authn_public_key_credential_request_options.rb +140 -0
  336. data/lib/models/web_authn_registration_challenge_response.rb +101 -0
  337. data/lib/models/web_authn_relying_party_entity.rb +95 -0
  338. data/lib/models/web_authn_sign_request.rb +83 -0
  339. data/lib/models/web_authn_sign_response.rb +84 -0
  340. data/lib/models/web_authn_user_entity.rb +105 -0
  341. data/lib/models/web_interface_branding_properties.rb +108 -0
  342. data/lib/models/webhook_option.rb +107 -0
  343. data/lib/models/win_smbauth.rb +102 -0
  344. data/lib/models/windows_code_sign_properties.rb +147 -0
  345. metadata +174 -2
@@ -0,0 +1,3785 @@
1
+ #!/usr/bin/env ruby --enable-frozen-string-literal
2
+ #
3
+ # Copyright (c) 2020-2022 Comet Licensing Ltd.
4
+ # Please see the LICENSE file for usage information.
5
+ #
6
+ # SPDX-License-Identifier: MIT
7
+ #
8
+ # frozen_string_literal: true
9
+
10
+ require 'net/http'
11
+ require 'json'
12
+
13
+ module Comet
14
+
15
+ # The CometServer class enables making network requests to the Comet Server API.
16
+ class CometServer
17
+
18
+ # @type [String] The Comet Server URL
19
+ attr_accessor :server_address
20
+
21
+ # @type [String] Username to log in to the Comet Server API
22
+ attr_accessor :username
23
+
24
+ # @type [String] Password to log in to the Comet Server API
25
+ attr_accessor :password
26
+
27
+ # Initialize a new CometServer class instance.
28
+ def initialize(server_address, username, password)
29
+ raise TypeError, "'server_address' expected String, got #{server_address.class}" unless server_address.is_a? String
30
+
31
+ raise TypeError, "'username' expected String, got #{username.class}" unless username.is_a? String
32
+
33
+ raise TypeError, "'password' expected String, got #{password.class}" unless password.is_a? String
34
+
35
+ @server_address = server_address
36
+ @username = username
37
+ @password = password
38
+
39
+ # Ensure Comet Server URL has a trailing slash
40
+ @server_address += '/' unless server_address.end_with?('/')
41
+ end
42
+
43
+ # AdminAccountProperties
44
+ #
45
+ # Retrieve properties about the current admin account.
46
+ # Some key parameters are obscured, but the obscured values are safely recognised by the corresponding AdminAccountSetProperties API.
47
+ #
48
+ # You must supply administrator authentication credentials to use this API.
49
+ #
50
+ # @return [Comet::AdminAccountPropertiesResponse]
51
+ def admin_account_properties
52
+ body = perform_request('api/v1/admin/account/properties')
53
+ json_body = JSON.parse body
54
+ check_status json_body
55
+ ret = Comet::AdminAccountPropertiesResponse.new
56
+ ret.from_hash(json_body)
57
+ ret
58
+ end
59
+
60
+ # AdminAccountRegenerateTotp
61
+ #
62
+ # Generate a new TOTP secret.
63
+ # The secret is returned as a `data-uri` image of a QR code. The new secret is immediately applied to the current admin account.
64
+ #
65
+ # You must supply administrator authentication credentials to use this API.
66
+ #
67
+ # @return [Comet::TotpRegeneratedResponse]
68
+ def admin_account_regenerate_totp
69
+ body = perform_request('api/v1/admin/account/regenerate-totp')
70
+ json_body = JSON.parse body
71
+ check_status json_body
72
+ ret = Comet::TotpRegeneratedResponse.new
73
+ ret.from_hash(json_body)
74
+ ret
75
+ end
76
+
77
+ # AdminAccountSessionRevoke
78
+ #
79
+ # Revoke a session key (log out).
80
+ #
81
+ # You must supply administrator authentication credentials to use this API.
82
+ #
83
+ # @return [Comet::CometAPIResponseMessage]
84
+ def admin_account_session_revoke
85
+ body = perform_request('api/v1/admin/account/session-revoke')
86
+ json_body = JSON.parse body
87
+ check_status json_body
88
+ ret = Comet::CometAPIResponseMessage.new
89
+ ret.from_hash(json_body)
90
+ ret
91
+ end
92
+
93
+ # AdminAccountSessionStart
94
+ #
95
+ # Generate a session key (log in).
96
+ #
97
+ # You must supply administrator authentication credentials to use this API.
98
+ #
99
+ # @param [String] self_address (Optional) External URL of this server
100
+ # @return [Comet::SessionKeyRegeneratedResponse]
101
+ def admin_account_session_start(self_address = nil)
102
+ submit_params = {}
103
+ if self_address.nil?
104
+ submit_params['SelfAddress'] = @server_address
105
+ else
106
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
107
+
108
+ submit_params['SelfAddress'] = self_address
109
+ end
110
+
111
+ body = perform_request('api/v1/admin/account/session-start', submit_params)
112
+ json_body = JSON.parse body
113
+ check_status json_body
114
+ ret = Comet::SessionKeyRegeneratedResponse.new
115
+ ret.from_hash(json_body)
116
+ ret
117
+ end
118
+
119
+ # AdminAccountSessionStartAsUser
120
+ #
121
+ # Generate a session key for an end-user (log in as end-user).
122
+ #
123
+ # You must supply administrator authentication credentials to use this API.
124
+ #
125
+ # @param [String] target_user Target account username
126
+ # @return [Comet::SessionKeyRegeneratedResponse]
127
+ def admin_account_session_start_as_user(target_user)
128
+ submit_params = {}
129
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
130
+
131
+ submit_params['TargetUser'] = target_user
132
+
133
+ body = perform_request('api/v1/admin/account/session-start-as-user', submit_params)
134
+ json_body = JSON.parse body
135
+ check_status json_body
136
+ ret = Comet::SessionKeyRegeneratedResponse.new
137
+ ret.from_hash(json_body)
138
+ ret
139
+ end
140
+
141
+ # AdminAccountSetProperties
142
+ #
143
+ # Update settings for your own admin account.
144
+ # Updating your account password requires you to supply your current password.
145
+ # To set a new plaintext password, use a password format of 0 (PASSWORD_FORMAT_PLAINTEXT).
146
+ # This API does not currently allow you to modify your TOTP secret or IP whitelist.
147
+ #
148
+ # You must supply administrator authentication credentials to use this API.
149
+ #
150
+ # @param [Comet::AdminSecurityOptions] security Updated account properties
151
+ # @return [Comet::CometAPIResponseMessage]
152
+ def admin_account_set_properties(security)
153
+ submit_params = {}
154
+ raise TypeError, "'security' expected Comet::AdminSecurityOptions, got #{security.class}" unless security.is_a? Comet::AdminSecurityOptions
155
+
156
+ submit_params['Security'] = security.to_json
157
+
158
+ body = perform_request('api/v1/admin/account/set-properties', submit_params)
159
+ json_body = JSON.parse body
160
+ check_status json_body
161
+ ret = Comet::CometAPIResponseMessage.new
162
+ ret.from_hash(json_body)
163
+ ret
164
+ end
165
+
166
+ # AdminAccountU2fRequestRegistrationChallenge
167
+ #
168
+ # Register a new FIDO U2F token.
169
+ # Browser support for U2F is ending in February 2022. WebAuthn is backwards
170
+ # compatible with U2F keys, and Comet will automatically migrate existing U2F keys
171
+ # to allow their use with the WebAuthn endpoints.
172
+ #
173
+ # You must supply administrator authentication credentials to use this API.
174
+ #
175
+ # @param [String] self_address External URL of this server, used as U2F AppID and Facet
176
+ # @return [Comet::U2FRegistrationChallengeResponse]
177
+ def admin_account_u2f_request_registration_challenge(self_address)
178
+ submit_params = {}
179
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
180
+
181
+ submit_params['SelfAddress'] = self_address
182
+
183
+ body = perform_request('api/v1/admin/account/u2f/request-registration-challenge', submit_params)
184
+ json_body = JSON.parse body
185
+ check_status json_body
186
+ ret = Comet::U2FRegistrationChallengeResponse.new
187
+ ret.from_hash(json_body)
188
+ ret
189
+ end
190
+
191
+ # AdminAccountU2fSubmitChallengeResponse
192
+ #
193
+ # Register a new FIDO U2F token.
194
+ # Browser support for U2F is ending in February 2022. WebAuthn is backwards
195
+ # compatible with U2F keys, and Comet will automatically migrate existing U2F keys
196
+ # to allow their use with the WebAuthn endpoints.
197
+ #
198
+ # You must supply administrator authentication credentials to use this API.
199
+ #
200
+ # @param [String] u2fchallenge_id Associated value from AdminAccountU2fRequestRegistrationChallenge API
201
+ # @param [String] u2fclient_data U2F response data supplied by hardware token
202
+ # @param [String] u2fregistration_data U2F response data supplied by hardware token
203
+ # @param [String] u2fversion U2F response data supplied by hardware token
204
+ # @param [String] description Optional description of the token
205
+ # @return [Comet::CometAPIResponseMessage]
206
+ def admin_account_u2f_submit_challenge_response(u2fchallenge_id, u2fclient_data, u2fregistration_data, u2fversion, description)
207
+ submit_params = {}
208
+ raise TypeError, "'u2fchallenge_id' expected String, got #{u2fchallenge_id.class}" unless u2fchallenge_id.is_a? String
209
+
210
+ submit_params['U2FChallengeID'] = u2fchallenge_id
211
+ raise TypeError, "'u2fclient_data' expected String, got #{u2fclient_data.class}" unless u2fclient_data.is_a? String
212
+
213
+ submit_params['U2FClientData'] = u2fclient_data
214
+ raise TypeError, "'u2fregistration_data' expected String, got #{u2fregistration_data.class}" unless u2fregistration_data.is_a? String
215
+
216
+ submit_params['U2FRegistrationData'] = u2fregistration_data
217
+ raise TypeError, "'u2fversion' expected String, got #{u2fversion.class}" unless u2fversion.is_a? String
218
+
219
+ submit_params['U2FVersion'] = u2fversion
220
+ raise TypeError, "'description' expected String, got #{description.class}" unless description.is_a? String
221
+
222
+ submit_params['Description'] = description
223
+
224
+ body = perform_request('api/v1/admin/account/u2f/submit-challenge-response', submit_params)
225
+ json_body = JSON.parse body
226
+ check_status json_body
227
+ ret = Comet::CometAPIResponseMessage.new
228
+ ret.from_hash(json_body)
229
+ ret
230
+ end
231
+
232
+ # AdminAccountValidateTotp
233
+ #
234
+ # Validate the TOTP code before turning 2fa(TOTP) on.
235
+ #
236
+ # You must supply administrator authentication credentials to use this API.
237
+ #
238
+ # @param [String] totpcode Six-digit code after scanning barcode image
239
+ # @return [Comet::CometAPIResponseMessage]
240
+ def admin_account_validate_totp(totpcode)
241
+ submit_params = {}
242
+ raise TypeError, "'totpcode' expected String, got #{totpcode.class}" unless totpcode.is_a? String
243
+
244
+ submit_params['TOTPCode'] = totpcode
245
+
246
+ body = perform_request('api/v1/admin/account/validate-totp', submit_params)
247
+ json_body = JSON.parse body
248
+ check_status json_body
249
+ ret = Comet::CometAPIResponseMessage.new
250
+ ret.from_hash(json_body)
251
+ ret
252
+ end
253
+
254
+ # AdminAccountWebauthnRequestRegistrationChallenge
255
+ #
256
+ # Register a new FIDO2 WebAuthn token.
257
+ #
258
+ # You must supply administrator authentication credentials to use this API.
259
+ #
260
+ # @param [String] self_address External URL of this server, used as WebAuthn ID
261
+ # @return [Comet::WebAuthnRegistrationChallengeResponse]
262
+ def admin_account_webauthn_request_registration_challenge(self_address)
263
+ submit_params = {}
264
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
265
+
266
+ submit_params['SelfAddress'] = self_address
267
+
268
+ body = perform_request('api/v1/admin/account/webauthn/request-registration-challenge', submit_params)
269
+ json_body = JSON.parse body
270
+ check_status json_body
271
+ ret = Comet::WebAuthnRegistrationChallengeResponse.new
272
+ ret.from_hash(json_body)
273
+ ret
274
+ end
275
+
276
+ # AdminAccountWebauthnSubmitChallengeResponse
277
+ #
278
+ # Register a new FIDO2 WebAuthn token.
279
+ #
280
+ # You must supply administrator authentication credentials to use this API.
281
+ #
282
+ # @param [String] self_address External URL of this server, used as WebAuthn ID
283
+ # @param [String] challenge_id Associated value from AdminAccountWebAuthnRequestRegistrationChallenge API
284
+ # @param [String] credential JSON-encoded credential
285
+ # @return [Comet::CometAPIResponseMessage]
286
+ def admin_account_webauthn_submit_challenge_response(self_address, challenge_id, credential)
287
+ submit_params = {}
288
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
289
+
290
+ submit_params['SelfAddress'] = self_address
291
+ raise TypeError, "'challenge_id' expected String, got #{challenge_id.class}" unless challenge_id.is_a? String
292
+
293
+ submit_params['ChallengeID'] = challenge_id
294
+ raise TypeError, "'credential' expected String, got #{credential.class}" unless credential.is_a? String
295
+
296
+ submit_params['Credential'] = credential
297
+
298
+ body = perform_request('api/v1/admin/account/webauthn/submit-challenge-response', submit_params)
299
+ json_body = JSON.parse body
300
+ check_status json_body
301
+ ret = Comet::CometAPIResponseMessage.new
302
+ ret.from_hash(json_body)
303
+ ret
304
+ end
305
+
306
+ # AdminAddUser
307
+ #
308
+ # Add a new user account.
309
+ #
310
+ # You must supply administrator authentication credentials to use this API.
311
+ # This API requires the Auth Role to be enabled.
312
+ #
313
+ # @param [String] target_user New account username
314
+ # @param [String] target_password New account password
315
+ # @param [Number] store_recovery_code (Optional) If set to 1, store and keep a password recovery code for the generated user (>= 18.3.9)
316
+ # @param [Number] require_password_change (Optional) If set to 1, require to reset password at the first login for the generated user (>= 20.3.4)
317
+ # @return [Comet::CometAPIResponseMessage]
318
+ def admin_add_user(target_user, target_password, store_recovery_code = nil, require_password_change = nil)
319
+ submit_params = {}
320
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
321
+
322
+ submit_params['TargetUser'] = target_user
323
+ raise TypeError, "'target_password' expected String, got #{target_password.class}" unless target_password.is_a? String
324
+
325
+ submit_params['TargetPassword'] = target_password
326
+ unless store_recovery_code.nil?
327
+ raise TypeError, "'store_recovery_code' expected Numeric, got #{store_recovery_code.class}" unless store_recovery_code.is_a? Numeric
328
+
329
+ submit_params['StoreRecoveryCode'] = store_recovery_code
330
+ end
331
+ unless require_password_change.nil?
332
+ raise TypeError, "'require_password_change' expected Numeric, got #{require_password_change.class}" unless require_password_change.is_a? Numeric
333
+
334
+ submit_params['RequirePasswordChange'] = require_password_change
335
+ end
336
+
337
+ body = perform_request('api/v1/admin/add-user', submit_params)
338
+ json_body = JSON.parse body
339
+ check_status json_body
340
+ ret = Comet::CometAPIResponseMessage.new
341
+ ret.from_hash(json_body)
342
+ ret
343
+ end
344
+
345
+ # AdminAddUserFromProfile
346
+ #
347
+ # Add a new user account (with all information).
348
+ # This allows you to create a new account and set all its properties at once (e.g. during account replication). Developers creating a signup form may find it simpler to use the AdminAddUser and AdminGetUserProfile / AdminSetUserProfile APIs separately.
349
+ #
350
+ # You must supply administrator authentication credentials to use this API.
351
+ # This API requires the Auth Role to be enabled.
352
+ #
353
+ # @param [String] target_user New account username
354
+ # @param [Comet::UserProfileConfig] profile_data New account profile
355
+ # @return [Comet::CometAPIResponseMessage]
356
+ def admin_add_user_from_profile(target_user, profile_data)
357
+ submit_params = {}
358
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
359
+
360
+ submit_params['TargetUser'] = target_user
361
+ raise TypeError, "'profile_data' expected Comet::UserProfileConfig, got #{profile_data.class}" unless profile_data.is_a? Comet::UserProfileConfig
362
+
363
+ submit_params['ProfileData'] = profile_data.to_json
364
+
365
+ body = perform_request('api/v1/admin/add-user-from-profile', submit_params)
366
+ json_body = JSON.parse body
367
+ check_status json_body
368
+ ret = Comet::CometAPIResponseMessage.new
369
+ ret.from_hash(json_body)
370
+ ret
371
+ end
372
+
373
+ # AdminAdminUserDelete
374
+ #
375
+ # Delete an administrator.
376
+ #
377
+ # You must supply administrator authentication credentials to use this API.
378
+ # Access to this API may be prevented on a per-administrator basis.
379
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
380
+ #
381
+ # @param [String] target_user the username of the admin to be deleted
382
+ # @return [Comet::CometAPIResponseMessage]
383
+ def admin_admin_user_delete(target_user)
384
+ submit_params = {}
385
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
386
+
387
+ submit_params['TargetUser'] = target_user
388
+
389
+ body = perform_request('api/v1/admin/admin-user/delete', submit_params)
390
+ json_body = JSON.parse body
391
+ check_status json_body
392
+ ret = Comet::CometAPIResponseMessage.new
393
+ ret.from_hash(json_body)
394
+ ret
395
+ end
396
+
397
+ # AdminAdminUserList
398
+ #
399
+ # List administrators.
400
+ #
401
+ # You must supply administrator authentication credentials to use this API.
402
+ # Access to this API may be prevented on a per-administrator basis.
403
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
404
+ #
405
+ # @return [Array<Comet::AllowedAdminUser>]
406
+ def admin_admin_user_list
407
+ body = perform_request('api/v1/admin/admin-user/list')
408
+ json_body = JSON.parse body
409
+ check_status json_body
410
+ if json_body.nil?
411
+ ret = []
412
+ else
413
+ ret = Array.new(json_body.length)
414
+ json_body.each_with_index do |v, i|
415
+ ret[i] = Comet::AllowedAdminUser.new
416
+ ret[i].from_hash(v)
417
+ end
418
+ end
419
+ ret
420
+ end
421
+
422
+ # AdminAdminUserNew
423
+ #
424
+ # Add a new administrator.
425
+ #
426
+ # You must supply administrator authentication credentials to use this API.
427
+ # Access to this API may be prevented on a per-administrator basis.
428
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
429
+ #
430
+ # @param [String] target_user the username for this new admin
431
+ # @param [String] target_password the password for this new admin user
432
+ # @param [String] target_org_id (Optional) provide the organization ID for this user, it will default to the org of the authenticating user otherwise
433
+ # @return [Comet::CometAPIResponseMessage]
434
+ def admin_admin_user_new(target_user, target_password, target_org_id = nil)
435
+ submit_params = {}
436
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
437
+
438
+ submit_params['TargetUser'] = target_user
439
+ raise TypeError, "'target_password' expected String, got #{target_password.class}" unless target_password.is_a? String
440
+
441
+ submit_params['TargetPassword'] = target_password
442
+ unless target_org_id.nil?
443
+ raise TypeError, "'target_org_id' expected String, got #{target_org_id.class}" unless target_org_id.is_a? String
444
+
445
+ submit_params['TargetOrgID'] = target_org_id
446
+ end
447
+
448
+ body = perform_request('api/v1/admin/admin-user/new', submit_params)
449
+ json_body = JSON.parse body
450
+ check_status json_body
451
+ ret = Comet::CometAPIResponseMessage.new
452
+ ret.from_hash(json_body)
453
+ ret
454
+ end
455
+
456
+ # AdminBrandingAvailablePlatforms
457
+ #
458
+ # List available software download platforms.
459
+ #
460
+ # This API requires administrator authentication credentials, unless the server is configured to allow unauthenticated software downloads.
461
+ # This API requires the Software Build Role to be enabled.
462
+ # This API requires the Auth Role to be enabled.
463
+ #
464
+ # @return [Hash{Number => Comet::AvailableDownload}]
465
+ def admin_branding_available_platforms
466
+ body = perform_request('api/v1/admin/branding/available-platforms')
467
+ json_body = JSON.parse body
468
+ check_status json_body
469
+ ret = {}
470
+ if json_body.nil?
471
+ ret = {}
472
+ else
473
+ json_body.each do |k, v|
474
+ ret[k] = Comet::AvailableDownload.new
475
+ ret[k].from_hash(v)
476
+ end
477
+ end
478
+ ret
479
+ end
480
+
481
+ # AdminBrandingGenerateClientByPlatform
482
+ #
483
+ # Download software.
484
+ #
485
+ # This API requires administrator authentication credentials, unless the server is configured to allow unauthenticated software downloads.
486
+ # This API requires the Software Build Role to be enabled.
487
+ # This API requires the Auth Role to be enabled.
488
+ #
489
+ # @param [Number] platform The selected download platform, from the AdminBrandingAvailablePlatforms API
490
+ # @param [String] self_address (Optional) The external URL of this server, used to resolve conflicts
491
+ # @return [String]
492
+ def admin_branding_generate_client_by_platform(platform, self_address = nil)
493
+ submit_params = {}
494
+ raise TypeError, "'platform' expected Numeric, got #{platform.class}" unless platform.is_a? Numeric
495
+
496
+ submit_params['Platform'] = platform
497
+ if self_address.nil?
498
+ submit_params['SelfAddress'] = @server_address
499
+ else
500
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
501
+
502
+ submit_params['SelfAddress'] = self_address
503
+ end
504
+
505
+ perform_request('api/v1/admin/branding/generate-client/by-platform', submit_params)
506
+ end
507
+
508
+ # AdminBrandingGenerateClientLinuxgeneric
509
+ #
510
+ # Download software (Linux Server .run).
511
+ #
512
+ # This API requires administrator authentication credentials, unless the server is configured to allow unauthenticated software downloads.
513
+ # This API requires the Software Build Role to be enabled.
514
+ # This API requires the Auth Role to be enabled.
515
+ #
516
+ # @param [String] self_address (Optional) The external URL of this server, used to resolve conflicts
517
+ # @return [String]
518
+ def admin_branding_generate_client_linuxgeneric(self_address = nil)
519
+ submit_params = {}
520
+ if self_address.nil?
521
+ submit_params['SelfAddress'] = @server_address
522
+ else
523
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
524
+
525
+ submit_params['SelfAddress'] = self_address
526
+ end
527
+
528
+ perform_request('api/v1/admin/branding/generate-client/linuxgeneric', submit_params)
529
+ end
530
+
531
+ # AdminBrandingGenerateClientMacosX8664
532
+ #
533
+ # Download software (macOS x86_64 pkg).
534
+ #
535
+ # This API requires administrator authentication credentials, unless the server is configured to allow unauthenticated software downloads.
536
+ # This API requires the Software Build Role to be enabled.
537
+ # This API requires the Auth Role to be enabled.
538
+ #
539
+ # @param [String] self_address (Optional) The external URL of this server, used to resolve conflicts
540
+ # @return [String]
541
+ def admin_branding_generate_client_macos_x8664(self_address = nil)
542
+ submit_params = {}
543
+ if self_address.nil?
544
+ submit_params['SelfAddress'] = @server_address
545
+ else
546
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
547
+
548
+ submit_params['SelfAddress'] = self_address
549
+ end
550
+
551
+ perform_request('api/v1/admin/branding/generate-client/macos-x86_64', submit_params)
552
+ end
553
+
554
+ # AdminBrandingGenerateClientSpkDsm6
555
+ #
556
+ # Download software (Synology SPK for DSM 6).
557
+ #
558
+ # This API requires administrator authentication credentials, unless the server is configured to allow unauthenticated software downloads.
559
+ # This API requires the Software Build Role to be enabled.
560
+ # This API requires the Auth Role to be enabled.
561
+ #
562
+ # @param [String] self_address (Optional) The external URL of this server, used to resolve conflicts
563
+ # @return [String]
564
+ def admin_branding_generate_client_spk_dsm_6(self_address = nil)
565
+ submit_params = {}
566
+ if self_address.nil?
567
+ submit_params['SelfAddress'] = @server_address
568
+ else
569
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
570
+
571
+ submit_params['SelfAddress'] = self_address
572
+ end
573
+
574
+ perform_request('api/v1/admin/branding/generate-client/spk-dsm6', submit_params)
575
+ end
576
+
577
+ # AdminBrandingGenerateClientSpkDsm7
578
+ #
579
+ # Download software (Synology SPK for DSM 7).
580
+ #
581
+ # This API requires administrator authentication credentials, unless the server is configured to allow unauthenticated software downloads.
582
+ # This API requires the Software Build Role to be enabled.
583
+ # This API requires the Auth Role to be enabled.
584
+ #
585
+ # @param [String] self_address (Optional) The external URL of this server, used to resolve conflicts
586
+ # @return [String]
587
+ def admin_branding_generate_client_spk_dsm_7(self_address = nil)
588
+ submit_params = {}
589
+ if self_address.nil?
590
+ submit_params['SelfAddress'] = @server_address
591
+ else
592
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
593
+
594
+ submit_params['SelfAddress'] = self_address
595
+ end
596
+
597
+ perform_request('api/v1/admin/branding/generate-client/spk-dsm7', submit_params)
598
+ end
599
+
600
+ # AdminBrandingGenerateClientTest
601
+ #
602
+ # Check if a software download is available.
603
+ #
604
+ # This API requires administrator authentication credentials, unless the server is configured to allow unauthenticated software downloads.
605
+ # This API requires the Software Build Role to be enabled.
606
+ # This API requires the Auth Role to be enabled.
607
+ #
608
+ # @param [Number] platform The selected download platform, from the AdminBrandingAvailablePlatforms API
609
+ # @param [String] self_address (Optional) The external URL of this server, used to resolve conflicts
610
+ # @return [Comet::CometAPIResponseMessage]
611
+ def admin_branding_generate_client_test(platform, self_address = nil)
612
+ submit_params = {}
613
+ raise TypeError, "'platform' expected Numeric, got #{platform.class}" unless platform.is_a? Numeric
614
+
615
+ submit_params['Platform'] = platform
616
+ if self_address.nil?
617
+ submit_params['SelfAddress'] = @server_address
618
+ else
619
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
620
+
621
+ submit_params['SelfAddress'] = self_address
622
+ end
623
+
624
+ body = perform_request('api/v1/admin/branding/generate-client/test', submit_params)
625
+ json_body = JSON.parse body
626
+ check_status json_body
627
+ ret = Comet::CometAPIResponseMessage.new
628
+ ret.from_hash(json_body)
629
+ ret
630
+ end
631
+
632
+ # AdminBrandingGenerateClientWindowsAnycpuExe
633
+ #
634
+ # Download software update (Windows AnyCPU exe).
635
+ # The exe endpoints are not recommended for end-users, as they may not be able to provide a codesigned installer if no custom codesigning certificate is present.
636
+ #
637
+ # This API requires administrator authentication credentials, unless the server is configured to allow unauthenticated software downloads.
638
+ # This API requires the Software Build Role to be enabled.
639
+ # This API requires the Auth Role to be enabled.
640
+ #
641
+ # @param [String] self_address (Optional) The external URL of this server, used to resolve conflicts
642
+ # @return [String]
643
+ def admin_branding_generate_client_windows_anycpu_exe(self_address = nil)
644
+ submit_params = {}
645
+ if self_address.nil?
646
+ submit_params['SelfAddress'] = @server_address
647
+ else
648
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
649
+
650
+ submit_params['SelfAddress'] = self_address
651
+ end
652
+
653
+ perform_request('api/v1/admin/branding/generate-client/windows-anycpu-exe', submit_params)
654
+ end
655
+
656
+ # AdminBrandingGenerateClientWindowsAnycpuZip
657
+ #
658
+ # Download software (Windows AnyCPU zip).
659
+ # The zip endpoints are recommended for end-users, as they may be able to provide a codesigned installer even when no custom codesigning certificate is present.
660
+ #
661
+ # This API requires administrator authentication credentials, unless the server is configured to allow unauthenticated software downloads.
662
+ # This API requires the Software Build Role to be enabled.
663
+ # This API requires the Auth Role to be enabled.
664
+ #
665
+ # @param [String] self_address (Optional) The external URL of this server, used to resolve conflicts
666
+ # @return [String]
667
+ def admin_branding_generate_client_windows_anycpu_zip(self_address = nil)
668
+ submit_params = {}
669
+ if self_address.nil?
670
+ submit_params['SelfAddress'] = @server_address
671
+ else
672
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
673
+
674
+ submit_params['SelfAddress'] = self_address
675
+ end
676
+
677
+ perform_request('api/v1/admin/branding/generate-client/windows-anycpu-zip', submit_params)
678
+ end
679
+
680
+ # AdminBrandingGenerateClientWindowsX8632Exe
681
+ #
682
+ # Download software update (Windows x86_32 exe).
683
+ # The exe endpoints are not recommended for end-users, as they may not be able to provide a codesigned installer if no custom codesigning certificate is present.
684
+ #
685
+ # This API requires administrator authentication credentials, unless the server is configured to allow unauthenticated software downloads.
686
+ # This API requires the Software Build Role to be enabled.
687
+ # This API requires the Auth Role to be enabled.
688
+ #
689
+ # @param [String] self_address (Optional) The external URL of this server, used to resolve conflicts
690
+ # @return [String]
691
+ def admin_branding_generate_client_windows_x8632exe(self_address = nil)
692
+ submit_params = {}
693
+ if self_address.nil?
694
+ submit_params['SelfAddress'] = @server_address
695
+ else
696
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
697
+
698
+ submit_params['SelfAddress'] = self_address
699
+ end
700
+
701
+ perform_request('api/v1/admin/branding/generate-client/windows-x86_32-exe', submit_params)
702
+ end
703
+
704
+ # AdminBrandingGenerateClientWindowsX8632Zip
705
+ #
706
+ # Download software (Windows x86_32 zip).
707
+ # The zip endpoints are recommended for end-users, as they may be able to provide a codesigned installer even when no custom codesigning certificate is present.
708
+ #
709
+ # This API requires administrator authentication credentials, unless the server is configured to allow unauthenticated software downloads.
710
+ # This API requires the Software Build Role to be enabled.
711
+ # This API requires the Auth Role to be enabled.
712
+ #
713
+ # @param [String] self_address (Optional) The external URL of this server, used to resolve conflicts
714
+ # @return [String]
715
+ def admin_branding_generate_client_windows_x8632zip(self_address = nil)
716
+ submit_params = {}
717
+ if self_address.nil?
718
+ submit_params['SelfAddress'] = @server_address
719
+ else
720
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
721
+
722
+ submit_params['SelfAddress'] = self_address
723
+ end
724
+
725
+ perform_request('api/v1/admin/branding/generate-client/windows-x86_32-zip', submit_params)
726
+ end
727
+
728
+ # AdminBrandingGenerateClientWindowsX8664Exe
729
+ #
730
+ # Download software update (Windows x86_64 exe).
731
+ # The exe endpoints are not recommended for end-users, as they may not be able to provide a codesigned installer if no custom codesigning certificate is present.
732
+ #
733
+ # This API requires administrator authentication credentials, unless the server is configured to allow unauthenticated software downloads.
734
+ # This API requires the Software Build Role to be enabled.
735
+ # This API requires the Auth Role to be enabled.
736
+ #
737
+ # @param [String] self_address (Optional) The external URL of this server, used to resolve conflicts
738
+ # @return [String]
739
+ def admin_branding_generate_client_windows_x8664exe(self_address = nil)
740
+ submit_params = {}
741
+ if self_address.nil?
742
+ submit_params['SelfAddress'] = @server_address
743
+ else
744
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
745
+
746
+ submit_params['SelfAddress'] = self_address
747
+ end
748
+
749
+ perform_request('api/v1/admin/branding/generate-client/windows-x86_64-exe', submit_params)
750
+ end
751
+
752
+ # AdminBrandingGenerateClientWindowsX8664Zip
753
+ #
754
+ # Download software (Windows x86_64 zip).
755
+ # The zip endpoints are recommended for end-users, as they may be able to provide a codesigned installer even when no custom codesigning certificate is present.
756
+ #
757
+ # This API requires administrator authentication credentials, unless the server is configured to allow unauthenticated software downloads.
758
+ # This API requires the Software Build Role to be enabled.
759
+ # This API requires the Auth Role to be enabled.
760
+ #
761
+ # @param [String] self_address (Optional) The external URL of this server, used to resolve conflicts
762
+ # @return [String]
763
+ def admin_branding_generate_client_windows_x8664zip(self_address = nil)
764
+ submit_params = {}
765
+ if self_address.nil?
766
+ submit_params['SelfAddress'] = @server_address
767
+ else
768
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
769
+
770
+ submit_params['SelfAddress'] = self_address
771
+ end
772
+
773
+ perform_request('api/v1/admin/branding/generate-client/windows-x86_64-zip', submit_params)
774
+ end
775
+
776
+ # AdminBulletinSubmit
777
+ #
778
+ # Send an email bulletin to all users.
779
+ #
780
+ # You must supply administrator authentication credentials to use this API.
781
+ # This API requires the Auth Role to be enabled.
782
+ #
783
+ # @param [String] subject Bulletin subject line
784
+ # @param [String] content Bulletin message content
785
+ # @return [Comet::CometAPIResponseMessage]
786
+ def admin_bulletin_submit(subject, content)
787
+ submit_params = {}
788
+ raise TypeError, "'subject' expected String, got #{subject.class}" unless subject.is_a? String
789
+
790
+ submit_params['Subject'] = subject
791
+ raise TypeError, "'content' expected String, got #{content.class}" unless content.is_a? String
792
+
793
+ submit_params['Content'] = content
794
+
795
+ body = perform_request('api/v1/admin/bulletin/submit', submit_params)
796
+ json_body = JSON.parse body
797
+ check_status json_body
798
+ ret = Comet::CometAPIResponseMessage.new
799
+ ret.from_hash(json_body)
800
+ ret
801
+ end
802
+
803
+ # AdminConstellationLastReport
804
+ #
805
+ # Get Constellation bucket usage report (cached).
806
+ #
807
+ # You must supply administrator authentication credentials to use this API.
808
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
809
+ # This API requires the Constellation Role to be enabled.
810
+ #
811
+ # @return [Comet::ConstellationCheckReport]
812
+ def admin_constellation_last_report
813
+ body = perform_request('api/v1/admin/constellation/last-report')
814
+ json_body = JSON.parse body
815
+ check_status json_body
816
+ ret = Comet::ConstellationCheckReport.new
817
+ ret.from_hash(json_body)
818
+ ret
819
+ end
820
+
821
+ # AdminConstellationNewReport
822
+ #
823
+ # Get Constellation bucket usage report (regenerate).
824
+ #
825
+ # You must supply administrator authentication credentials to use this API.
826
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
827
+ # This API requires the Constellation Role to be enabled.
828
+ #
829
+ # @return [Comet::ConstellationCheckReport]
830
+ def admin_constellation_new_report
831
+ body = perform_request('api/v1/admin/constellation/new-report')
832
+ json_body = JSON.parse body
833
+ check_status json_body
834
+ ret = Comet::ConstellationCheckReport.new
835
+ ret.from_hash(json_body)
836
+ ret
837
+ end
838
+
839
+ # AdminConstellationPruneNow
840
+ #
841
+ # Prune unused buckets.
842
+ #
843
+ # You must supply administrator authentication credentials to use this API.
844
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
845
+ # This API requires the Constellation Role to be enabled.
846
+ #
847
+ # @return [Comet::CometAPIResponseMessage]
848
+ def admin_constellation_prune_now
849
+ body = perform_request('api/v1/admin/constellation/prune-now')
850
+ json_body = JSON.parse body
851
+ check_status json_body
852
+ ret = Comet::CometAPIResponseMessage.new
853
+ ret.from_hash(json_body)
854
+ ret
855
+ end
856
+
857
+ # AdminConstellationStatus
858
+ #
859
+ # Get Constellation status.
860
+ #
861
+ # You must supply administrator authentication credentials to use this API.
862
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
863
+ # This API requires the Constellation Role to be enabled.
864
+ #
865
+ # @return [Comet::ConstellationStatusAPIResponse]
866
+ def admin_constellation_status
867
+ body = perform_request('api/v1/admin/constellation/status')
868
+ json_body = JSON.parse body
869
+ check_status json_body
870
+ ret = Comet::ConstellationStatusAPIResponse.new
871
+ ret.from_hash(json_body)
872
+ ret
873
+ end
874
+
875
+ # AdminCreateInstallToken
876
+ #
877
+ # Create token for silent installation.
878
+ # Currently only supported for Windows & macOS only
879
+ # Provide the installation token to silently install the client on windows `install.exe /TOKEN=<installtoken>`
880
+ # Provide the installation token to silently install the client on Mac OS `sudo launchctl setenv BACKUP_APP_TOKEN "installtoken" && sudo /usr/sbin/installer -allowUntrusted -pkg "Comet Backup.pkg" -target /`
881
+ #
882
+ # You must supply administrator authentication credentials to use this API.
883
+ # This API requires the Auth Role to be enabled.
884
+ #
885
+ # @param [String] target_user Selected account username
886
+ # @param [String] target_password Selected account password
887
+ # @param [String] server (Optional) External URL of the authentication server that is different from the current server
888
+ # @return [Comet::InstallTokenResponse]
889
+ def admin_create_install_token(target_user, target_password, server = nil)
890
+ submit_params = {}
891
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
892
+
893
+ submit_params['TargetUser'] = target_user
894
+ raise TypeError, "'target_password' expected String, got #{target_password.class}" unless target_password.is_a? String
895
+
896
+ submit_params['TargetPassword'] = target_password
897
+ unless server.nil?
898
+ raise TypeError, "'server' expected String, got #{server.class}" unless server.is_a? String
899
+
900
+ submit_params['Server'] = server
901
+ end
902
+
903
+ body = perform_request('api/v1/admin/create-install-token', submit_params)
904
+ json_body = JSON.parse body
905
+ check_status json_body
906
+ ret = Comet::InstallTokenResponse.new
907
+ ret.from_hash(json_body)
908
+ ret
909
+ end
910
+
911
+ # AdminDeleteUser
912
+ #
913
+ # Delete user account.
914
+ # This does not remove any storage buckets. Unused storage buckets will be cleaned up by the Constellation Role.
915
+ # Any stored data can not be decrypted without the user profile. Misuse can cause data loss!
916
+ # This also allows to uninstall software from active devices under the user account
917
+ # This also removes all job history for the user account.
918
+ #
919
+ # You must supply administrator authentication credentials to use this API.
920
+ # This API requires the Auth Role to be enabled.
921
+ #
922
+ # @param [String] target_user Selected account username
923
+ # @param [Comet::UninstallConfig] uninstall_config (Optional) Uninstall software configuration (>= 20.3.5)
924
+ # @return [Comet::CometAPIResponseMessage]
925
+ def admin_delete_user(target_user, uninstall_config = nil)
926
+ submit_params = {}
927
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
928
+
929
+ submit_params['TargetUser'] = target_user
930
+ unless uninstall_config.nil?
931
+ raise TypeError, "'uninstall_config' expected Comet::UninstallConfig, got #{uninstall_config.class}" unless uninstall_config.is_a? Comet::UninstallConfig
932
+
933
+ submit_params['UninstallConfig'] = uninstall_config.to_json
934
+ end
935
+
936
+ body = perform_request('api/v1/admin/delete-user', submit_params)
937
+ json_body = JSON.parse body
938
+ check_status json_body
939
+ ret = Comet::CometAPIResponseMessage.new
940
+ ret.from_hash(json_body)
941
+ ret
942
+ end
943
+
944
+ # AdminDisableUserTotp
945
+ #
946
+ # Disable user account 2FA(TOTP) authentication.
947
+ #
948
+ # You must supply administrator authentication credentials to use this API.
949
+ # This API requires the Auth Role to be enabled.
950
+ #
951
+ # @param [String] target_user Selected account username
952
+ # @return [Comet::CometAPIResponseMessage]
953
+ def admin_disable_user_totp(target_user)
954
+ submit_params = {}
955
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
956
+
957
+ submit_params['TargetUser'] = target_user
958
+
959
+ body = perform_request('api/v1/admin/disable-user-totp', submit_params)
960
+ json_body = JSON.parse body
961
+ check_status json_body
962
+ ret = Comet::CometAPIResponseMessage.new
963
+ ret.from_hash(json_body)
964
+ ret
965
+ end
966
+
967
+ # AdminDispatcherApplyRetentionRules
968
+ #
969
+ # Instruct a live connected device to apply retention rules now.
970
+ # This command is understood by Comet Backup 17.6.9 and newer.
971
+ #
972
+ # You must supply administrator authentication credentials to use this API.
973
+ # This API requires the Auth Role to be enabled.
974
+ #
975
+ # @param [String] target_id The live connection GUID
976
+ # @param [String] destination The Storage Vault GUID
977
+ # @return [Comet::CometAPIResponseMessage]
978
+ def admin_dispatcher_apply_retention_rules(target_id, destination)
979
+ submit_params = {}
980
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
981
+
982
+ submit_params['TargetID'] = target_id
983
+ raise TypeError, "'destination' expected String, got #{destination.class}" unless destination.is_a? String
984
+
985
+ submit_params['Destination'] = destination
986
+
987
+ body = perform_request('api/v1/admin/dispatcher/apply-retention-rules', submit_params)
988
+ json_body = JSON.parse body
989
+ check_status json_body
990
+ ret = Comet::CometAPIResponseMessage.new
991
+ ret.from_hash(json_body)
992
+ ret
993
+ end
994
+
995
+ # AdminDispatcherDeepverifyStorageVault
996
+ #
997
+ # Instruct a live connected device to deeply verify Storage Vault content.
998
+ # This command is understood by Comet Backup 18.8.2 and newer.
999
+ #
1000
+ # You must supply administrator authentication credentials to use this API.
1001
+ # This API requires the Auth Role to be enabled.
1002
+ #
1003
+ # @param [String] target_id The live connection GUID
1004
+ # @param [String] destination The Storage Vault GUID
1005
+ # @return [Comet::CometAPIResponseMessage]
1006
+ def admin_dispatcher_deepverify_storage_vault(target_id, destination)
1007
+ submit_params = {}
1008
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1009
+
1010
+ submit_params['TargetID'] = target_id
1011
+ raise TypeError, "'destination' expected String, got #{destination.class}" unless destination.is_a? String
1012
+
1013
+ submit_params['Destination'] = destination
1014
+
1015
+ body = perform_request('api/v1/admin/dispatcher/deepverify-storage-vault', submit_params)
1016
+ json_body = JSON.parse body
1017
+ check_status json_body
1018
+ ret = Comet::CometAPIResponseMessage.new
1019
+ ret.from_hash(json_body)
1020
+ ret
1021
+ end
1022
+
1023
+ # AdminDispatcherDeleteSnapshot
1024
+ #
1025
+ # Instruct a live connected device to delete a stored snapshot.
1026
+ #
1027
+ # You must supply administrator authentication credentials to use this API.
1028
+ # This API requires the Auth Role to be enabled.
1029
+ #
1030
+ # @param [String] target_id The live connection GUID
1031
+ # @param [String] destination_id The Storage Vault GUID
1032
+ # @param [String] snapshot_id The backup job snapshot ID to delete
1033
+ # @return [Comet::CometAPIResponseMessage]
1034
+ def admin_dispatcher_delete_snapshot(target_id, destination_id, snapshot_id)
1035
+ submit_params = {}
1036
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1037
+
1038
+ submit_params['TargetID'] = target_id
1039
+ raise TypeError, "'destination_id' expected String, got #{destination_id.class}" unless destination_id.is_a? String
1040
+
1041
+ submit_params['DestinationID'] = destination_id
1042
+ raise TypeError, "'snapshot_id' expected String, got #{snapshot_id.class}" unless snapshot_id.is_a? String
1043
+
1044
+ submit_params['SnapshotID'] = snapshot_id
1045
+
1046
+ body = perform_request('api/v1/admin/dispatcher/delete-snapshot', submit_params)
1047
+ json_body = JSON.parse body
1048
+ check_status json_body
1049
+ ret = Comet::CometAPIResponseMessage.new
1050
+ ret.from_hash(json_body)
1051
+ ret
1052
+ end
1053
+
1054
+ # AdminDispatcherDeleteSnapshots
1055
+ #
1056
+ # Instruct a live connected device to delete multiple stored snapshots.
1057
+ # The target device must be running Comet 20.9.10 or later.
1058
+ #
1059
+ # You must supply administrator authentication credentials to use this API.
1060
+ # This API requires the Auth Role to be enabled.
1061
+ #
1062
+ # @param [String] target_id The live connection GUID
1063
+ # @param [String] destination_id The Storage Vault GUID
1064
+ # @param [Array<String>] snapshot_ids The backup job snapshot IDs to delete
1065
+ # @return [Comet::CometAPIResponseMessage]
1066
+ def admin_dispatcher_delete_snapshots(target_id, destination_id, snapshot_ids)
1067
+ submit_params = {}
1068
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1069
+
1070
+ submit_params['TargetID'] = target_id
1071
+ raise TypeError, "'destination_id' expected String, got #{destination_id.class}" unless destination_id.is_a? String
1072
+
1073
+ submit_params['DestinationID'] = destination_id
1074
+ raise TypeError, "'snapshot_ids' expected Array, got #{snapshot_ids.class}" unless snapshot_ids.is_a? Array
1075
+
1076
+ submit_params['SnapshotIDs'] = snapshot_ids.to_json
1077
+
1078
+ body = perform_request('api/v1/admin/dispatcher/delete-snapshots', submit_params)
1079
+ json_body = JSON.parse body
1080
+ check_status json_body
1081
+ ret = Comet::CometAPIResponseMessage.new
1082
+ ret.from_hash(json_body)
1083
+ ret
1084
+ end
1085
+
1086
+ # AdminDispatcherDropConnection
1087
+ #
1088
+ # Disconnect a live connected device.
1089
+ # The device will almost certainly attempt to reconnect.
1090
+ #
1091
+ # You must supply administrator authentication credentials to use this API.
1092
+ # This API requires the Auth Role to be enabled.
1093
+ #
1094
+ # @param [String] target_id The live connection GUID
1095
+ # @return [Comet::CometAPIResponseMessage]
1096
+ def admin_dispatcher_drop_connection(target_id)
1097
+ submit_params = {}
1098
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1099
+
1100
+ submit_params['TargetID'] = target_id
1101
+
1102
+ body = perform_request('api/v1/admin/dispatcher/drop-connection', submit_params)
1103
+ json_body = JSON.parse body
1104
+ check_status json_body
1105
+ ret = Comet::CometAPIResponseMessage.new
1106
+ ret.from_hash(json_body)
1107
+ ret
1108
+ end
1109
+
1110
+ # AdminDispatcherEmailPreview
1111
+ #
1112
+ # Request HTML content of an email.
1113
+ # The remote device must have given consent for an MSP to browse their mail
1114
+ #
1115
+ # You must supply administrator authentication credentials to use this API.
1116
+ # This API requires the Auth Role to be enabled.
1117
+ #
1118
+ # @param [String] target_id The live connection GUID
1119
+ # @param [String] snapshot where the email belongs to
1120
+ # @param [String] destination The Storage Vault ID
1121
+ # @param [String] path of the email to view
1122
+ # @return [Comet::EmailReportGeneratedPreview]
1123
+ def admin_dispatcher_email_preview(target_id, snapshot, destination, path)
1124
+ submit_params = {}
1125
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1126
+
1127
+ submit_params['TargetID'] = target_id
1128
+ raise TypeError, "'snapshot' expected String, got #{snapshot.class}" unless snapshot.is_a? String
1129
+
1130
+ submit_params['Snapshot'] = snapshot
1131
+ raise TypeError, "'destination' expected String, got #{destination.class}" unless destination.is_a? String
1132
+
1133
+ submit_params['Destination'] = destination
1134
+ raise TypeError, "'path' expected String, got #{path.class}" unless path.is_a? String
1135
+
1136
+ submit_params['Path'] = path
1137
+
1138
+ body = perform_request('api/v1/admin/dispatcher/email-preview', submit_params)
1139
+ json_body = JSON.parse body
1140
+ check_status json_body
1141
+ ret = Comet::EmailReportGeneratedPreview.new
1142
+ ret.from_hash(json_body)
1143
+ ret
1144
+ end
1145
+
1146
+ # AdminDispatcherImportApply
1147
+ #
1148
+ # Instruct a live connected device to import settings from an installed product.
1149
+ # This command is understood by Comet Backup 17.12.0 and newer.
1150
+ #
1151
+ # You must supply administrator authentication credentials to use this API.
1152
+ # This API requires the Auth Role to be enabled.
1153
+ #
1154
+ # @param [String] target_id The live connection GUID
1155
+ # @param [String] import_source_id The selected import source, as found by the AdminDispatcherRequestImportSources API
1156
+ # @return [Comet::CometAPIResponseMessage]
1157
+ def admin_dispatcher_import_apply(target_id, import_source_id)
1158
+ submit_params = {}
1159
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1160
+
1161
+ submit_params['TargetID'] = target_id
1162
+ raise TypeError, "'import_source_id' expected String, got #{import_source_id.class}" unless import_source_id.is_a? String
1163
+
1164
+ submit_params['ImportSourceID'] = import_source_id
1165
+
1166
+ body = perform_request('api/v1/admin/dispatcher/import-apply', submit_params)
1167
+ json_body = JSON.parse body
1168
+ check_status json_body
1169
+ ret = Comet::CometAPIResponseMessage.new
1170
+ ret.from_hash(json_body)
1171
+ ret
1172
+ end
1173
+
1174
+ # AdminDispatcherKillProcess
1175
+ #
1176
+ # Instruct a live connected device to disconnect.
1177
+ # The device will terminate its live-connection process and will not reconnect.
1178
+ #
1179
+ # You must supply administrator authentication credentials to use this API.
1180
+ # This API requires the Auth Role to be enabled.
1181
+ #
1182
+ # @param [String] target_id The live connection GUID
1183
+ # @return [Comet::CometAPIResponseMessage]
1184
+ def admin_dispatcher_kill_process(target_id)
1185
+ submit_params = {}
1186
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1187
+
1188
+ submit_params['TargetID'] = target_id
1189
+
1190
+ body = perform_request('api/v1/admin/dispatcher/kill-process', submit_params)
1191
+ json_body = JSON.parse body
1192
+ check_status json_body
1193
+ ret = Comet::CometAPIResponseMessage.new
1194
+ ret.from_hash(json_body)
1195
+ ret
1196
+ end
1197
+
1198
+ # AdminDispatcherListActive
1199
+ #
1200
+ # List live connected devices.
1201
+ #
1202
+ # You must supply administrator authentication credentials to use this API.
1203
+ # This API requires the Auth Role to be enabled.
1204
+ #
1205
+ # @return [Hash{String => Comet::LiveUserConnection}]
1206
+ def admin_dispatcher_list_active
1207
+ body = perform_request('api/v1/admin/dispatcher/list-active')
1208
+ json_body = JSON.parse body
1209
+ check_status json_body
1210
+ ret = {}
1211
+ if json_body.nil?
1212
+ ret = {}
1213
+ else
1214
+ json_body.each do |k, v|
1215
+ ret[k] = Comet::LiveUserConnection.new
1216
+ ret[k].from_hash(v)
1217
+ end
1218
+ end
1219
+ ret
1220
+ end
1221
+
1222
+ # AdminDispatcherOffice365ListVirtualAccounts
1223
+ #
1224
+ # Request a list of Office365 Resources (groups, sites, teams groups and users).
1225
+ # The remote device must have given consent for an MSP to browse their files.
1226
+ #
1227
+ # You must supply administrator authentication credentials to use this API.
1228
+ # This API requires the Auth Role to be enabled.
1229
+ #
1230
+ # @param [String] target_id The live connection GUID
1231
+ # @param [Comet::Office365Credential] credentials The Office365 account credential
1232
+ # @return [Comet::BrowseOffice365ListVirtualAccountsResponse]
1233
+ def admin_dispatcher_office_365list_virtual_accounts(target_id, credentials)
1234
+ submit_params = {}
1235
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1236
+
1237
+ submit_params['TargetID'] = target_id
1238
+ raise TypeError, "'credentials' expected Comet::Office365Credential, got #{credentials.class}" unless credentials.is_a? Comet::Office365Credential
1239
+
1240
+ submit_params['Credentials'] = credentials.to_json
1241
+
1242
+ body = perform_request('api/v1/admin/dispatcher/office365-list-virtual-accounts', submit_params)
1243
+ json_body = JSON.parse body
1244
+ check_status json_body
1245
+ ret = Comet::BrowseOffice365ListVirtualAccountsResponse.new
1246
+ ret.from_hash(json_body)
1247
+ ret
1248
+ end
1249
+
1250
+ # AdminDispatcherPingDestination
1251
+ #
1252
+ # Test the connection to the storage bucket.
1253
+ #
1254
+ # You must supply administrator authentication credentials to use this API.
1255
+ # This API requires the Auth Role to be enabled.
1256
+ #
1257
+ # @param [String] target_id The live connection GUID
1258
+ # @param [Comet::DestinationLocation] extra_data The destination location settings
1259
+ # @return [Comet::CometAPIResponseMessage]
1260
+ def admin_dispatcher_ping_destination(target_id, extra_data)
1261
+ submit_params = {}
1262
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1263
+
1264
+ submit_params['TargetID'] = target_id
1265
+ raise TypeError, "'extra_data' expected Comet::DestinationLocation, got #{extra_data.class}" unless extra_data.is_a? Comet::DestinationLocation
1266
+
1267
+ submit_params['ExtraData'] = extra_data.to_json
1268
+
1269
+ body = perform_request('api/v1/admin/dispatcher/ping-destination', submit_params)
1270
+ json_body = JSON.parse body
1271
+ check_status json_body
1272
+ ret = Comet::CometAPIResponseMessage.new
1273
+ ret.from_hash(json_body)
1274
+ ret
1275
+ end
1276
+
1277
+ # AdminDispatcherRefetchProfile
1278
+ #
1279
+ # Instruct a live connected device to refresh their profile.
1280
+ # This command is understood by Comet Backup 17.12.0 and newer.
1281
+ #
1282
+ # You must supply administrator authentication credentials to use this API.
1283
+ # This API requires the Auth Role to be enabled.
1284
+ #
1285
+ # @param [String] target_id The live connection GUID
1286
+ # @return [Comet::CometAPIResponseMessage]
1287
+ def admin_dispatcher_refetch_profile(target_id)
1288
+ submit_params = {}
1289
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1290
+
1291
+ submit_params['TargetID'] = target_id
1292
+
1293
+ body = perform_request('api/v1/admin/dispatcher/refetch-profile', submit_params)
1294
+ json_body = JSON.parse body
1295
+ check_status json_body
1296
+ ret = Comet::CometAPIResponseMessage.new
1297
+ ret.from_hash(json_body)
1298
+ ret
1299
+ end
1300
+
1301
+ # AdminDispatcherRegisterOfficeApplicationBegin
1302
+ #
1303
+ # Begin the process of registering a new Azure AD application that can access Office 365 for backup.
1304
+ # After calling this API, you should supply the login details to the end-user, and then begin polling the AdminDispatcherRegisterOfficeApplicationCheck with the supplied "Continuation" parameter to check on the registration process.
1305
+ #
1306
+ # You must supply administrator authentication credentials to use this API.
1307
+ # This API requires the Auth Role to be enabled.
1308
+ #
1309
+ # @param [String] target_id The live connection GUID
1310
+ # @param [String] email_address The email address of the Azure AD administrator
1311
+ # @return [Comet::RegisterOfficeApplicationBeginResponse]
1312
+ def admin_dispatcher_register_office_application_begin(target_id, email_address)
1313
+ submit_params = {}
1314
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1315
+
1316
+ submit_params['TargetID'] = target_id
1317
+ raise TypeError, "'email_address' expected String, got #{email_address.class}" unless email_address.is_a? String
1318
+
1319
+ submit_params['EmailAddress'] = email_address
1320
+
1321
+ body = perform_request('api/v1/admin/dispatcher/register-office-application/begin', submit_params)
1322
+ json_body = JSON.parse body
1323
+ check_status json_body
1324
+ ret = Comet::RegisterOfficeApplicationBeginResponse.new
1325
+ ret.from_hash(json_body)
1326
+ ret
1327
+ end
1328
+
1329
+ # AdminDispatcherRegisterOfficeApplicationCheck
1330
+ #
1331
+ # Check the process of registering a new Azure AD application that can access Office 365 for backup.
1332
+ # You should begin the process by calling AdminDispatcherRegisterOfficeApplicationBegin and asking the end-user to complete the Azure authentication steps.
1333
+ #
1334
+ # You must supply administrator authentication credentials to use this API.
1335
+ # This API requires the Auth Role to be enabled.
1336
+ #
1337
+ # @param [String] target_id The live connection GUID
1338
+ # @param [String] continuation The ID returned from the AdminDispatcherRegisterOfficeApplicationBegin endpoint
1339
+ # @return [Comet::RegisterOfficeApplicationCheckResponse]
1340
+ def admin_dispatcher_register_office_application_check(target_id, continuation)
1341
+ submit_params = {}
1342
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1343
+
1344
+ submit_params['TargetID'] = target_id
1345
+ raise TypeError, "'continuation' expected String, got #{continuation.class}" unless continuation.is_a? String
1346
+
1347
+ submit_params['Continuation'] = continuation
1348
+
1349
+ body = perform_request('api/v1/admin/dispatcher/register-office-application/check', submit_params)
1350
+ json_body = JSON.parse body
1351
+ check_status json_body
1352
+ ret = Comet::RegisterOfficeApplicationCheckResponse.new
1353
+ ret.from_hash(json_body)
1354
+ ret
1355
+ end
1356
+
1357
+ # AdminDispatcherReindexStorageVault
1358
+ #
1359
+ # Instruct a live connected device to rebuild Storage Vault indexes now.
1360
+ # This command is understood by Comet Backup 18.6.9 and newer.
1361
+ #
1362
+ # You must supply administrator authentication credentials to use this API.
1363
+ # This API requires the Auth Role to be enabled.
1364
+ #
1365
+ # @param [String] target_id The live connection GUID
1366
+ # @param [String] destination The Storage Vault GUID
1367
+ # @return [Comet::CometAPIResponseMessage]
1368
+ def admin_dispatcher_reindex_storage_vault(target_id, destination)
1369
+ submit_params = {}
1370
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1371
+
1372
+ submit_params['TargetID'] = target_id
1373
+ raise TypeError, "'destination' expected String, got #{destination.class}" unless destination.is_a? String
1374
+
1375
+ submit_params['Destination'] = destination
1376
+
1377
+ body = perform_request('api/v1/admin/dispatcher/reindex-storage-vault', submit_params)
1378
+ json_body = JSON.parse body
1379
+ check_status json_body
1380
+ ret = Comet::CometAPIResponseMessage.new
1381
+ ret.from_hash(json_body)
1382
+ ret
1383
+ end
1384
+
1385
+ # AdminDispatcherRequestBrowseDiskDrives
1386
+ #
1387
+ # Request a list of physical disk drive information from a live connected device.
1388
+ #
1389
+ # You must supply administrator authentication credentials to use this API.
1390
+ # This API requires the Auth Role to be enabled.
1391
+ #
1392
+ # @param [String] target_id The live connection GUID
1393
+ # @return [Comet::BrowseDiskDrivesResponse]
1394
+ def admin_dispatcher_request_browse_disk_drives(target_id)
1395
+ submit_params = {}
1396
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1397
+
1398
+ submit_params['TargetID'] = target_id
1399
+
1400
+ body = perform_request('api/v1/admin/dispatcher/request-browse-disk-drives', submit_params)
1401
+ json_body = JSON.parse body
1402
+ check_status json_body
1403
+ ret = Comet::BrowseDiskDrivesResponse.new
1404
+ ret.from_hash(json_body)
1405
+ ret
1406
+ end
1407
+
1408
+ # AdminDispatcherRequestBrowseExchangeEdb
1409
+ #
1410
+ # Request a list of Exchange EDB databases from a live connected device.
1411
+ #
1412
+ # You must supply administrator authentication credentials to use this API.
1413
+ # This API requires the Auth Role to be enabled.
1414
+ #
1415
+ # @param [String] target_id The live connection GUID
1416
+ # @return [Comet::BrowseEDBResponse]
1417
+ def admin_dispatcher_request_browse_exchange_edb(target_id)
1418
+ submit_params = {}
1419
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1420
+
1421
+ submit_params['TargetID'] = target_id
1422
+
1423
+ body = perform_request('api/v1/admin/dispatcher/request-browse-exchange-edb', submit_params)
1424
+ json_body = JSON.parse body
1425
+ check_status json_body
1426
+ ret = Comet::BrowseEDBResponse.new
1427
+ ret.from_hash(json_body)
1428
+ ret
1429
+ end
1430
+
1431
+ # AdminDispatcherRequestBrowseHyperv
1432
+ #
1433
+ # Request a list of Hyper-V virtual machines from a live connected device.
1434
+ #
1435
+ # You must supply administrator authentication credentials to use this API.
1436
+ # This API requires the Auth Role to be enabled.
1437
+ #
1438
+ # @param [String] target_id The live connection GUID
1439
+ # @return [Comet::BrowseHVResponse]
1440
+ def admin_dispatcher_request_browse_hyperv(target_id)
1441
+ submit_params = {}
1442
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1443
+
1444
+ submit_params['TargetID'] = target_id
1445
+
1446
+ body = perform_request('api/v1/admin/dispatcher/request-browse-hyperv', submit_params)
1447
+ json_body = JSON.parse body
1448
+ check_status json_body
1449
+ ret = Comet::BrowseHVResponse.new
1450
+ ret.from_hash(json_body)
1451
+ ret
1452
+ end
1453
+
1454
+ # AdminDispatcherRequestBrowseMongodb
1455
+ #
1456
+ # Request a list of tables in MongoDB database.
1457
+ # The remote device must have given consent for an MSP to browse their files.
1458
+ #
1459
+ # You must supply administrator authentication credentials to use this API.
1460
+ # This API requires the Auth Role to be enabled.
1461
+ #
1462
+ # @param [String] target_id The live connection GUID
1463
+ # @param [Comet::MongoDBConnection] credentials The Mongo database authentication settings
1464
+ # @return [Comet::BrowseSQLServerResponse]
1465
+ def admin_dispatcher_request_browse_mongodb(target_id, credentials)
1466
+ submit_params = {}
1467
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1468
+
1469
+ submit_params['TargetID'] = target_id
1470
+ raise TypeError, "'credentials' expected Comet::MongoDBConnection, got #{credentials.class}" unless credentials.is_a? Comet::MongoDBConnection
1471
+
1472
+ submit_params['Credentials'] = credentials.to_json
1473
+
1474
+ body = perform_request('api/v1/admin/dispatcher/request-browse-mongodb', submit_params)
1475
+ json_body = JSON.parse body
1476
+ check_status json_body
1477
+ ret = Comet::BrowseSQLServerResponse.new
1478
+ ret.from_hash(json_body)
1479
+ ret
1480
+ end
1481
+
1482
+ # AdminDispatcherRequestBrowseMssql
1483
+ #
1484
+ # Request a list of tables in MSSQL database.
1485
+ # The remote device must have given consent for an MSP to browse their files.
1486
+ #
1487
+ # You must supply administrator authentication credentials to use this API.
1488
+ # This API requires the Auth Role to be enabled.
1489
+ #
1490
+ # @param [String] target_id The live connection GUID
1491
+ # @param [Comet::MSSQLConnection] credentials The MSSQL database authentication settings
1492
+ # @return [Comet::BrowseSQLServerResponse]
1493
+ def admin_dispatcher_request_browse_mssql(target_id, credentials)
1494
+ submit_params = {}
1495
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1496
+
1497
+ submit_params['TargetID'] = target_id
1498
+ raise TypeError, "'credentials' expected Comet::MSSQLConnection, got #{credentials.class}" unless credentials.is_a? Comet::MSSQLConnection
1499
+
1500
+ submit_params['Credentials'] = credentials.to_json
1501
+
1502
+ body = perform_request('api/v1/admin/dispatcher/request-browse-mssql', submit_params)
1503
+ json_body = JSON.parse body
1504
+ check_status json_body
1505
+ ret = Comet::BrowseSQLServerResponse.new
1506
+ ret.from_hash(json_body)
1507
+ ret
1508
+ end
1509
+
1510
+ # AdminDispatcherRequestBrowseMysql
1511
+ #
1512
+ # Request a list of tables in MySQL database.
1513
+ # The remote device must have given consent for an MSP to browse their files.
1514
+ #
1515
+ # You must supply administrator authentication credentials to use this API.
1516
+ # This API requires the Auth Role to be enabled.
1517
+ #
1518
+ # @param [String] target_id The live connection GUID
1519
+ # @param [Comet::MySQLConnection] credentials The MySQL database authentication settings
1520
+ # @return [Comet::BrowseSQLServerResponse]
1521
+ def admin_dispatcher_request_browse_mysql(target_id, credentials)
1522
+ submit_params = {}
1523
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1524
+
1525
+ submit_params['TargetID'] = target_id
1526
+ raise TypeError, "'credentials' expected Comet::MySQLConnection, got #{credentials.class}" unless credentials.is_a? Comet::MySQLConnection
1527
+
1528
+ submit_params['Credentials'] = credentials.to_json
1529
+
1530
+ body = perform_request('api/v1/admin/dispatcher/request-browse-mysql', submit_params)
1531
+ json_body = JSON.parse body
1532
+ check_status json_body
1533
+ ret = Comet::BrowseSQLServerResponse.new
1534
+ ret.from_hash(json_body)
1535
+ ret
1536
+ end
1537
+
1538
+ # AdminDispatcherRequestBrowseVssAaw
1539
+ #
1540
+ # Request a list of installed VSS Writers (Application-Aware Writers) from a live connected device.
1541
+ #
1542
+ # You must supply administrator authentication credentials to use this API.
1543
+ # This API requires the Auth Role to be enabled.
1544
+ #
1545
+ # @param [String] target_id The live connection GUID
1546
+ # @return [Comet::BrowseVSSResponse]
1547
+ def admin_dispatcher_request_browse_vss_aaw(target_id)
1548
+ submit_params = {}
1549
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1550
+
1551
+ submit_params['TargetID'] = target_id
1552
+
1553
+ body = perform_request('api/v1/admin/dispatcher/request-browse-vss-aaw', submit_params)
1554
+ json_body = JSON.parse body
1555
+ check_status json_body
1556
+ ret = Comet::BrowseVSSResponse.new
1557
+ ret.from_hash(json_body)
1558
+ ret
1559
+ end
1560
+
1561
+ # AdminDispatcherRequestFilesystemObjects
1562
+ #
1563
+ # Request a list of filesystem objects from a live connected device.
1564
+ # The device must have granted the administrator permission to view its filenames.
1565
+ #
1566
+ # You must supply administrator authentication credentials to use this API.
1567
+ # This API requires the Auth Role to be enabled.
1568
+ #
1569
+ # @param [String] target_id The live connection GUID
1570
+ # @param [String] path (Optional) Browse objects inside this path. If empty or not present, returns the top-level device paths
1571
+ # @return [Comet::DispatcherStoredObjectsResponse]
1572
+ def admin_dispatcher_request_filesystem_objects(target_id, path = nil)
1573
+ submit_params = {}
1574
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1575
+
1576
+ submit_params['TargetID'] = target_id
1577
+ unless path.nil?
1578
+ raise TypeError, "'path' expected String, got #{path.class}" unless path.is_a? String
1579
+
1580
+ submit_params['Path'] = path
1581
+ end
1582
+
1583
+ body = perform_request('api/v1/admin/dispatcher/request-filesystem-objects', submit_params)
1584
+ json_body = JSON.parse body
1585
+ check_status json_body
1586
+ ret = Comet::DispatcherStoredObjectsResponse.new
1587
+ ret.from_hash(json_body)
1588
+ ret
1589
+ end
1590
+
1591
+ # AdminDispatcherRequestImportSources
1592
+ #
1593
+ # Request a list of import sources from a live connected device.
1594
+ #
1595
+ # You must supply administrator authentication credentials to use this API.
1596
+ # This API requires the Auth Role to be enabled.
1597
+ #
1598
+ # @param [String] target_id The live connection GUID
1599
+ # @return [Comet::DispatcherAdminSourcesResponse]
1600
+ def admin_dispatcher_request_import_sources(target_id)
1601
+ submit_params = {}
1602
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1603
+
1604
+ submit_params['TargetID'] = target_id
1605
+
1606
+ body = perform_request('api/v1/admin/dispatcher/request-import-sources', submit_params)
1607
+ json_body = JSON.parse body
1608
+ check_status json_body
1609
+ ret = Comet::DispatcherAdminSourcesResponse.new
1610
+ ret.from_hash(json_body)
1611
+ ret
1612
+ end
1613
+
1614
+ # AdminDispatcherRequestOffice365Accounts
1615
+ #
1616
+ # Request a list of Office365 mailbox accounts.
1617
+ # The remote device must have given consent for an MSP to browse their files.
1618
+ #
1619
+ # You must supply administrator authentication credentials to use this API.
1620
+ # This API requires the Auth Role to be enabled.
1621
+ #
1622
+ # @param [String] target_id The live connection GUID
1623
+ # @param [Comet::Office365Credential] credentials The Office365 account credential
1624
+ # @return [Comet::BrowseOffice365ObjectsResponse]
1625
+ def admin_dispatcher_request_office_365accounts(target_id, credentials)
1626
+ submit_params = {}
1627
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1628
+
1629
+ submit_params['TargetID'] = target_id
1630
+ raise TypeError, "'credentials' expected Comet::Office365Credential, got #{credentials.class}" unless credentials.is_a? Comet::Office365Credential
1631
+
1632
+ submit_params['Credentials'] = credentials.to_json
1633
+
1634
+ body = perform_request('api/v1/admin/dispatcher/request-office365-accounts', submit_params)
1635
+ json_body = JSON.parse body
1636
+ check_status json_body
1637
+ ret = Comet::BrowseOffice365ObjectsResponse.new
1638
+ ret.from_hash(json_body)
1639
+ ret
1640
+ end
1641
+
1642
+ # AdminDispatcherRequestOffice365Sites
1643
+ #
1644
+ # Request a list of Office365 sites.
1645
+ # The remote device must have given consent for an MSP to browse their files.
1646
+ #
1647
+ # You must supply administrator authentication credentials to use this API.
1648
+ # This API requires the Auth Role to be enabled.
1649
+ #
1650
+ # @param [String] target_id The live connection GUID
1651
+ # @param [Comet::Office365Credential] credentials The Office365 account credential
1652
+ # @return [Comet::BrowseOffice365ObjectsResponse]
1653
+ def admin_dispatcher_request_office_365sites(target_id, credentials)
1654
+ submit_params = {}
1655
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1656
+
1657
+ submit_params['TargetID'] = target_id
1658
+ raise TypeError, "'credentials' expected Comet::Office365Credential, got #{credentials.class}" unless credentials.is_a? Comet::Office365Credential
1659
+
1660
+ submit_params['Credentials'] = credentials.to_json
1661
+
1662
+ body = perform_request('api/v1/admin/dispatcher/request-office365-sites', submit_params)
1663
+ json_body = JSON.parse body
1664
+ check_status json_body
1665
+ ret = Comet::BrowseOffice365ObjectsResponse.new
1666
+ ret.from_hash(json_body)
1667
+ ret
1668
+ end
1669
+
1670
+ # AdminDispatcherRequestStoredObjects
1671
+ #
1672
+ # Request a list of stored objects inside an existing backup job.
1673
+ # The remote device must have given consent for an MSP to browse their files.
1674
+ # To service this request, the remote device must connect to the Storage Vault and load index data. There may be a small delay. If the remote device is running Comet 20.12.0 or later, the necessary index data is cached when this API is first called, for 15 minutes after the last repeated call. This can improve performance for interactively browsing an entire tree of stored objects.
1675
+ #
1676
+ # You must supply administrator authentication credentials to use this API.
1677
+ # This API requires the Auth Role to be enabled.
1678
+ #
1679
+ # @param [String] target_id The live connection GUID
1680
+ # @param [String] destination The Storage Vault ID
1681
+ # @param [String] snapshot_id The selected backup job snapshot
1682
+ # @param [String] tree_id (Optional) Browse objects inside subdirectory of backup snapshot. If it is for VMDK single file restore, it should be the disk image's subtree ID.
1683
+ # @param [Comet::VMDKSnapshotViewOptions] options (Optional) Request a list of stored objects in vmdk file
1684
+ # @return [Comet::DispatcherStoredObjectsResponse]
1685
+ def admin_dispatcher_request_stored_objects(target_id, destination, snapshot_id, tree_id = nil, options = nil)
1686
+ submit_params = {}
1687
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1688
+
1689
+ submit_params['TargetID'] = target_id
1690
+ raise TypeError, "'destination' expected String, got #{destination.class}" unless destination.is_a? String
1691
+
1692
+ submit_params['Destination'] = destination
1693
+ raise TypeError, "'snapshot_id' expected String, got #{snapshot_id.class}" unless snapshot_id.is_a? String
1694
+
1695
+ submit_params['SnapshotID'] = snapshot_id
1696
+ unless tree_id.nil?
1697
+ raise TypeError, "'tree_id' expected String, got #{tree_id.class}" unless tree_id.is_a? String
1698
+
1699
+ submit_params['TreeID'] = tree_id
1700
+ end
1701
+ unless options.nil?
1702
+ raise TypeError, "'options' expected Comet::VMDKSnapshotViewOptions, got #{options.class}" unless options.is_a? Comet::VMDKSnapshotViewOptions
1703
+
1704
+ submit_params['Options'] = options.to_json
1705
+ end
1706
+
1707
+ body = perform_request('api/v1/admin/dispatcher/request-stored-objects', submit_params)
1708
+ json_body = JSON.parse body
1709
+ check_status json_body
1710
+ ret = Comet::DispatcherStoredObjectsResponse.new
1711
+ ret.from_hash(json_body)
1712
+ ret
1713
+ end
1714
+
1715
+ # AdminDispatcherRequestVaultSnapshots
1716
+ #
1717
+ # Request a list of Storage Vault snapshots from a live connected device.
1718
+ #
1719
+ # You must supply administrator authentication credentials to use this API.
1720
+ # This API requires the Auth Role to be enabled.
1721
+ #
1722
+ # @param [String] target_id The live connection GUID
1723
+ # @param [String] destination The Storage Vault ID
1724
+ # @return [Comet::DispatcherVaultSnapshotsResponse]
1725
+ def admin_dispatcher_request_vault_snapshots(target_id, destination)
1726
+ submit_params = {}
1727
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1728
+
1729
+ submit_params['TargetID'] = target_id
1730
+ raise TypeError, "'destination' expected String, got #{destination.class}" unless destination.is_a? String
1731
+
1732
+ submit_params['Destination'] = destination
1733
+
1734
+ body = perform_request('api/v1/admin/dispatcher/request-vault-snapshots', submit_params)
1735
+ json_body = JSON.parse body
1736
+ check_status json_body
1737
+ ret = Comet::DispatcherVaultSnapshotsResponse.new
1738
+ ret.from_hash(json_body)
1739
+ ret
1740
+ end
1741
+
1742
+ # AdminDispatcherRequestWindiskSnapshot
1743
+ #
1744
+ # Request a Disk Image snapshot with the windiskbrowse-style from a live connected device.
1745
+ #
1746
+ # You must supply administrator authentication credentials to use this API.
1747
+ # This API requires the Auth Role to be enabled.
1748
+ #
1749
+ # @param [String] target_id The live connection GUID
1750
+ # @param [String] destination The Storage Vault ID
1751
+ # @param [String] snapshot_id The Snapshot ID
1752
+ # @return [Comet::DispatcherWindiskSnapshotResponse]
1753
+ def admin_dispatcher_request_windisk_snapshot(target_id, destination, snapshot_id)
1754
+ submit_params = {}
1755
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1756
+
1757
+ submit_params['TargetID'] = target_id
1758
+ raise TypeError, "'destination' expected String, got #{destination.class}" unless destination.is_a? String
1759
+
1760
+ submit_params['Destination'] = destination
1761
+ raise TypeError, "'snapshot_id' expected String, got #{snapshot_id.class}" unless snapshot_id.is_a? String
1762
+
1763
+ submit_params['SnapshotID'] = snapshot_id
1764
+
1765
+ body = perform_request('api/v1/admin/dispatcher/request-windisk-snapshot', submit_params)
1766
+ json_body = JSON.parse body
1767
+ check_status json_body
1768
+ ret = Comet::DispatcherWindiskSnapshotResponse.new
1769
+ ret.from_hash(json_body)
1770
+ ret
1771
+ end
1772
+
1773
+ # AdminDispatcherRunBackup
1774
+ #
1775
+ # Instruct a live connected device to run a scheduled backup.
1776
+ #
1777
+ # You must supply administrator authentication credentials to use this API.
1778
+ # This API requires the Auth Role to be enabled.
1779
+ #
1780
+ # @param [String] target_id The live connection GUID
1781
+ # @param [String] backup_rule The schedule GUID
1782
+ # @return [Comet::CometAPIResponseMessage]
1783
+ def admin_dispatcher_run_backup(target_id, backup_rule)
1784
+ submit_params = {}
1785
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1786
+
1787
+ submit_params['TargetID'] = target_id
1788
+ raise TypeError, "'backup_rule' expected String, got #{backup_rule.class}" unless backup_rule.is_a? String
1789
+
1790
+ submit_params['BackupRule'] = backup_rule
1791
+
1792
+ body = perform_request('api/v1/admin/dispatcher/run-backup', submit_params)
1793
+ json_body = JSON.parse body
1794
+ check_status json_body
1795
+ ret = Comet::CometAPIResponseMessage.new
1796
+ ret.from_hash(json_body)
1797
+ ret
1798
+ end
1799
+
1800
+ # AdminDispatcherRunBackupCustom
1801
+ #
1802
+ # Instruct a live connected device to run a backup.
1803
+ #
1804
+ # You must supply administrator authentication credentials to use this API.
1805
+ # This API requires the Auth Role to be enabled.
1806
+ #
1807
+ # @param [String] target_id The live connection GUID
1808
+ # @param [String] source The Protected Item GUID
1809
+ # @param [String] destination The Storage Vault GUID
1810
+ # @param [Comet::BackupJobAdvancedOptions] options (Optional) Extra job parameters (>= 19.3.6)
1811
+ # @return [Comet::CometAPIResponseMessage]
1812
+ def admin_dispatcher_run_backup_custom(target_id, source, destination, options = nil)
1813
+ submit_params = {}
1814
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1815
+
1816
+ submit_params['TargetID'] = target_id
1817
+ raise TypeError, "'source' expected String, got #{source.class}" unless source.is_a? String
1818
+
1819
+ submit_params['Source'] = source
1820
+ raise TypeError, "'destination' expected String, got #{destination.class}" unless destination.is_a? String
1821
+
1822
+ submit_params['Destination'] = destination
1823
+ unless options.nil?
1824
+ raise TypeError, "'options' expected Comet::BackupJobAdvancedOptions, got #{options.class}" unless options.is_a? Comet::BackupJobAdvancedOptions
1825
+
1826
+ submit_params['Options'] = options.to_json
1827
+ end
1828
+
1829
+ body = perform_request('api/v1/admin/dispatcher/run-backup-custom', submit_params)
1830
+ json_body = JSON.parse body
1831
+ check_status json_body
1832
+ ret = Comet::CometAPIResponseMessage.new
1833
+ ret.from_hash(json_body)
1834
+ ret
1835
+ end
1836
+
1837
+ # AdminDispatcherRunRestore
1838
+ #
1839
+ # Instruct a live connected device to perform a local restore.
1840
+ # This command is understood by Comet Backup 17.9.3 and newer.
1841
+ #
1842
+ # You must supply administrator authentication credentials to use this API.
1843
+ # This API requires the Auth Role to be enabled.
1844
+ #
1845
+ # @param [String] target_id The live connection GUID
1846
+ # @param [String] path The local path to restore to
1847
+ # @param [String] source The Protected Item ID
1848
+ # @param [String] destination The Storage Vault ID
1849
+ # @param [String] snapshot (Optional) If present, restore a specific snapshot. Otherwise, restore the latest snapshot for the selected Protected Item + Storage Vault pair
1850
+ # @param [Array<String>] paths (Optional) If present, restore these paths only. Otherwise, restore all data (>= 19.3.0)
1851
+ # @return [Comet::CometAPIResponseMessage]
1852
+ def admin_dispatcher_run_restore(target_id, path, source, destination, snapshot = nil, paths = nil)
1853
+ submit_params = {}
1854
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1855
+
1856
+ submit_params['TargetID'] = target_id
1857
+ raise TypeError, "'path' expected String, got #{path.class}" unless path.is_a? String
1858
+
1859
+ submit_params['Path'] = path
1860
+ raise TypeError, "'source' expected String, got #{source.class}" unless source.is_a? String
1861
+
1862
+ submit_params['Source'] = source
1863
+ raise TypeError, "'destination' expected String, got #{destination.class}" unless destination.is_a? String
1864
+
1865
+ submit_params['Destination'] = destination
1866
+ unless snapshot.nil?
1867
+ raise TypeError, "'snapshot' expected String, got #{snapshot.class}" unless snapshot.is_a? String
1868
+
1869
+ submit_params['Snapshot'] = snapshot
1870
+ end
1871
+ unless paths.nil?
1872
+ raise TypeError, "'paths' expected Array, got #{paths.class}" unless paths.is_a? Array
1873
+
1874
+ submit_params['Paths'] = paths.to_json
1875
+ end
1876
+
1877
+ body = perform_request('api/v1/admin/dispatcher/run-restore', submit_params)
1878
+ json_body = JSON.parse body
1879
+ check_status json_body
1880
+ ret = Comet::CometAPIResponseMessage.new
1881
+ ret.from_hash(json_body)
1882
+ ret
1883
+ end
1884
+
1885
+ # AdminDispatcherRunRestoreCustom
1886
+ #
1887
+ # Instruct a live connected device to perform a local restore.
1888
+ # This command is understood by Comet Backup 18.6.0 and newer.
1889
+ #
1890
+ # You must supply administrator authentication credentials to use this API.
1891
+ # This API requires the Auth Role to be enabled.
1892
+ #
1893
+ # @param [String] target_id The live connection GUID
1894
+ # @param [String] source The Protected Item ID
1895
+ # @param [String] destination The Storage Vault ID
1896
+ # @param [Comet::RestoreJobAdvancedOptions] options Restore targets
1897
+ # @param [String] snapshot (Optional) If present, restore a specific snapshot. Otherwise, restore the latest snapshot for the selected Protected Item + Storage Vault pair
1898
+ # @param [Array<String>] paths (Optional) If present, restore these paths only. Otherwise, restore all data
1899
+ # @return [Comet::CometAPIResponseMessage]
1900
+ def admin_dispatcher_run_restore_custom(target_id, source, destination, options, snapshot = nil, paths = nil)
1901
+ submit_params = {}
1902
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1903
+
1904
+ submit_params['TargetID'] = target_id
1905
+ raise TypeError, "'source' expected String, got #{source.class}" unless source.is_a? String
1906
+
1907
+ submit_params['Source'] = source
1908
+ raise TypeError, "'destination' expected String, got #{destination.class}" unless destination.is_a? String
1909
+
1910
+ submit_params['Destination'] = destination
1911
+ raise TypeError, "'options' expected Comet::RestoreJobAdvancedOptions, got #{options.class}" unless options.is_a? Comet::RestoreJobAdvancedOptions
1912
+
1913
+ submit_params['Options'] = options.to_json
1914
+ unless snapshot.nil?
1915
+ raise TypeError, "'snapshot' expected String, got #{snapshot.class}" unless snapshot.is_a? String
1916
+
1917
+ submit_params['Snapshot'] = snapshot
1918
+ end
1919
+ unless paths.nil?
1920
+ raise TypeError, "'paths' expected Array, got #{paths.class}" unless paths.is_a? Array
1921
+
1922
+ submit_params['Paths'] = paths.to_json
1923
+ end
1924
+
1925
+ body = perform_request('api/v1/admin/dispatcher/run-restore-custom', submit_params)
1926
+ json_body = JSON.parse body
1927
+ check_status json_body
1928
+ ret = Comet::CometAPIResponseMessage.new
1929
+ ret.from_hash(json_body)
1930
+ ret
1931
+ end
1932
+
1933
+ # AdminDispatcherUninstallSoftware
1934
+ #
1935
+ # Instruct a live connected device to self-uninstall the software.
1936
+ #
1937
+ # You must supply administrator authentication credentials to use this API.
1938
+ # This API requires the Auth Role to be enabled.
1939
+ #
1940
+ # @param [String] target_id The live connection GUID
1941
+ # @param [Boolean] remove_config_file Determine if the config.dat file will be deleted at the same time
1942
+ # @return [Comet::CometAPIResponseMessage]
1943
+ def admin_dispatcher_uninstall_software(target_id, remove_config_file)
1944
+ submit_params = {}
1945
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1946
+
1947
+ submit_params['TargetID'] = target_id
1948
+ submit_params['RemoveConfigFile'] = (remove_config_file ? 1 : 0)
1949
+
1950
+ body = perform_request('api/v1/admin/dispatcher/uninstall-software', submit_params)
1951
+ json_body = JSON.parse body
1952
+ check_status json_body
1953
+ ret = Comet::CometAPIResponseMessage.new
1954
+ ret.from_hash(json_body)
1955
+ ret
1956
+ end
1957
+
1958
+ # AdminDispatcherUnlock
1959
+ #
1960
+ # Instruct a live connected device to remove lock files from a Storage Vault.
1961
+ # Misuse can cause data loss!
1962
+ # This command is understood by Comet Backup 17.9.4 and newer.
1963
+ #
1964
+ # You must supply administrator authentication credentials to use this API.
1965
+ # This API requires the Auth Role to be enabled.
1966
+ #
1967
+ # @param [String] target_id The live connection GUID
1968
+ # @param [String] destination The Storage Vault GUID
1969
+ # @return [Comet::CometAPIResponseMessage]
1970
+ def admin_dispatcher_unlock(target_id, destination)
1971
+ submit_params = {}
1972
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1973
+
1974
+ submit_params['TargetID'] = target_id
1975
+ raise TypeError, "'destination' expected String, got #{destination.class}" unless destination.is_a? String
1976
+
1977
+ submit_params['Destination'] = destination
1978
+
1979
+ body = perform_request('api/v1/admin/dispatcher/unlock', submit_params)
1980
+ json_body = JSON.parse body
1981
+ check_status json_body
1982
+ ret = Comet::CometAPIResponseMessage.new
1983
+ ret.from_hash(json_body)
1984
+ ret
1985
+ end
1986
+
1987
+ # AdminDispatcherUpdateLoginUrl
1988
+ #
1989
+ # Instruct a live connected device to update its login server URL.
1990
+ # The device will attempt to connect to the new Auth Role Comet Server using its current username and password. If the test connection succeeds, the device migrates its saved connection settings and live connections to the new server. If the device is not registered on the new URL, or if the credentials are incorrect, the device remains on the current Auth Role server.
1991
+ #
1992
+ # You must supply administrator authentication credentials to use this API.
1993
+ # This API requires the Auth Role to be enabled.
1994
+ #
1995
+ # @param [String] target_id The live connection GUID
1996
+ # @param [String] new_url The new external URL of this server
1997
+ # @return [Comet::CometAPIResponseMessage]
1998
+ def admin_dispatcher_update_login_url(target_id, new_url)
1999
+ submit_params = {}
2000
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
2001
+
2002
+ submit_params['TargetID'] = target_id
2003
+ raise TypeError, "'new_url' expected String, got #{new_url.class}" unless new_url.is_a? String
2004
+
2005
+ submit_params['NewURL'] = new_url
2006
+
2007
+ body = perform_request('api/v1/admin/dispatcher/update-login-url', submit_params)
2008
+ json_body = JSON.parse body
2009
+ check_status json_body
2010
+ ret = Comet::CometAPIResponseMessage.new
2011
+ ret.from_hash(json_body)
2012
+ ret
2013
+ end
2014
+
2015
+ # AdminDispatcherUpdateSoftware
2016
+ #
2017
+ # Instruct a live connected device to download a software update.
2018
+ #
2019
+ # You must supply administrator authentication credentials to use this API.
2020
+ # This API requires the Auth Role to be enabled.
2021
+ # This API requires the Software Build Role to be enabled.
2022
+ #
2023
+ # @param [String] target_id The live connection GUID
2024
+ # @param [String] self_address (Optional) The external URL of this server, used to resolve conflicts (>= 19.3.11)
2025
+ # @return [Comet::CometAPIResponseMessage]
2026
+ def admin_dispatcher_update_software(target_id, self_address = nil)
2027
+ submit_params = {}
2028
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
2029
+
2030
+ submit_params['TargetID'] = target_id
2031
+ if self_address.nil?
2032
+ submit_params['SelfAddress'] = @server_address
2033
+ else
2034
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
2035
+
2036
+ submit_params['SelfAddress'] = self_address
2037
+ end
2038
+
2039
+ body = perform_request('api/v1/admin/dispatcher/update-software', submit_params)
2040
+ json_body = JSON.parse body
2041
+ check_status json_body
2042
+ ret = Comet::CometAPIResponseMessage.new
2043
+ ret.from_hash(json_body)
2044
+ ret
2045
+ end
2046
+
2047
+ # AdminGetJobLog
2048
+ #
2049
+ # Get the report log entries for a single job, in plaintext format.
2050
+ #
2051
+ # You must supply administrator authentication credentials to use this API.
2052
+ # This API requires the Auth Role to be enabled.
2053
+ #
2054
+ # @param [String] job_id Selected job ID
2055
+ # @return [String]
2056
+ def admin_get_job_log(job_id)
2057
+ submit_params = {}
2058
+ raise TypeError, "'job_id' expected String, got #{job_id.class}" unless job_id.is_a? String
2059
+
2060
+ submit_params['JobID'] = job_id
2061
+
2062
+ perform_request('api/v1/admin/get-job-log', submit_params)
2063
+ end
2064
+
2065
+ # AdminGetJobLogEntries
2066
+ #
2067
+ # Get the report log entries for a single job.
2068
+ #
2069
+ # You must supply administrator authentication credentials to use this API.
2070
+ # This API requires the Auth Role to be enabled.
2071
+ #
2072
+ # @param [String] job_id Selected job ID
2073
+ # @return [Array<Comet::JobEntry>]
2074
+ def admin_get_job_log_entries(job_id)
2075
+ submit_params = {}
2076
+ raise TypeError, "'job_id' expected String, got #{job_id.class}" unless job_id.is_a? String
2077
+
2078
+ submit_params['JobID'] = job_id
2079
+
2080
+ body = perform_request('api/v1/admin/get-job-log-entries', submit_params)
2081
+ json_body = JSON.parse body
2082
+ check_status json_body
2083
+ if json_body.nil?
2084
+ ret = []
2085
+ else
2086
+ ret = Array.new(json_body.length)
2087
+ json_body.each_with_index do |v, i|
2088
+ ret[i] = Comet::JobEntry.new
2089
+ ret[i].from_hash(v)
2090
+ end
2091
+ end
2092
+ ret
2093
+ end
2094
+
2095
+ # AdminGetJobProperties
2096
+ #
2097
+ # Get properties of a single job.
2098
+ #
2099
+ # You must supply administrator authentication credentials to use this API.
2100
+ # This API requires the Auth Role to be enabled.
2101
+ #
2102
+ # @param [String] job_id Selected job ID
2103
+ # @return [Comet::BackupJobDetail]
2104
+ def admin_get_job_properties(job_id)
2105
+ submit_params = {}
2106
+ raise TypeError, "'job_id' expected String, got #{job_id.class}" unless job_id.is_a? String
2107
+
2108
+ submit_params['JobID'] = job_id
2109
+
2110
+ body = perform_request('api/v1/admin/get-job-properties', submit_params)
2111
+ json_body = JSON.parse body
2112
+ check_status json_body
2113
+ ret = Comet::BackupJobDetail.new
2114
+ ret.from_hash(json_body)
2115
+ ret
2116
+ end
2117
+
2118
+ # AdminGetJobsAll
2119
+ #
2120
+ # Get jobs (All).
2121
+ # The jobs are returned in an unspecified order.
2122
+ #
2123
+ # You must supply administrator authentication credentials to use this API.
2124
+ # This API requires the Auth Role to be enabled.
2125
+ #
2126
+ # @return [Array<Comet::BackupJobDetail>]
2127
+ def admin_get_jobs_all
2128
+ body = perform_request('api/v1/admin/get-jobs-all')
2129
+ json_body = JSON.parse body
2130
+ check_status json_body
2131
+ if json_body.nil?
2132
+ ret = []
2133
+ else
2134
+ ret = Array.new(json_body.length)
2135
+ json_body.each_with_index do |v, i|
2136
+ ret[i] = Comet::BackupJobDetail.new
2137
+ ret[i].from_hash(v)
2138
+ end
2139
+ end
2140
+ ret
2141
+ end
2142
+
2143
+ # AdminGetJobsForCustomSearch
2144
+ #
2145
+ # Get jobs (for custom search).
2146
+ # The jobs are returned in an unspecified order.
2147
+ #
2148
+ # You must supply administrator authentication credentials to use this API.
2149
+ # This API requires the Auth Role to be enabled.
2150
+ #
2151
+ # @param [Comet::SearchClause] query (No description available)
2152
+ # @return [Array<Comet::BackupJobDetail>]
2153
+ def admin_get_jobs_for_custom_search(query)
2154
+ submit_params = {}
2155
+ raise TypeError, "'query' expected Comet::SearchClause, got #{query.class}" unless query.is_a? Comet::SearchClause
2156
+
2157
+ submit_params['Query'] = query.to_json
2158
+
2159
+ body = perform_request('api/v1/admin/get-jobs-for-custom-search', submit_params)
2160
+ json_body = JSON.parse body
2161
+ check_status json_body
2162
+ if json_body.nil?
2163
+ ret = []
2164
+ else
2165
+ ret = Array.new(json_body.length)
2166
+ json_body.each_with_index do |v, i|
2167
+ ret[i] = Comet::BackupJobDetail.new
2168
+ ret[i].from_hash(v)
2169
+ end
2170
+ end
2171
+ ret
2172
+ end
2173
+
2174
+ # AdminGetJobsForDateRange
2175
+ #
2176
+ # Get jobs (for date range).
2177
+ # The jobs are returned in an unspecified order.
2178
+ #
2179
+ # If the `Start` parameter is later than `End`, they will be swapped.
2180
+ #
2181
+ # This API will return all jobs that either started or ended within the supplied range.
2182
+ #
2183
+ # Incomplete jobs have an end time of `0`. You can use this API to find incomplete jobs by setting both `Start` and `End` to `0`.
2184
+ #
2185
+ # You must supply administrator authentication credentials to use this API.
2186
+ # This API requires the Auth Role to be enabled.
2187
+ #
2188
+ # @param [Number] start_value Timestamp (Unix)
2189
+ # @param [Number] end_value Timestamp (Unix)
2190
+ # @return [Array<Comet::BackupJobDetail>]
2191
+ def admin_get_jobs_for_date_range(start_value, end_value)
2192
+ submit_params = {}
2193
+ raise TypeError, "'start_value' expected Numeric, got #{start_value.class}" unless start_value.is_a? Numeric
2194
+
2195
+ submit_params['Start'] = start_value
2196
+ raise TypeError, "'end_value' expected Numeric, got #{end_value.class}" unless end_value.is_a? Numeric
2197
+
2198
+ submit_params['End'] = end_value
2199
+
2200
+ body = perform_request('api/v1/admin/get-jobs-for-date-range', submit_params)
2201
+ json_body = JSON.parse body
2202
+ check_status json_body
2203
+ if json_body.nil?
2204
+ ret = []
2205
+ else
2206
+ ret = Array.new(json_body.length)
2207
+ json_body.each_with_index do |v, i|
2208
+ ret[i] = Comet::BackupJobDetail.new
2209
+ ret[i].from_hash(v)
2210
+ end
2211
+ end
2212
+ ret
2213
+ end
2214
+
2215
+ # AdminGetJobsForUser
2216
+ #
2217
+ # Get jobs (for user).
2218
+ # The jobs are returned in an unspecified order.
2219
+ #
2220
+ # You must supply administrator authentication credentials to use this API.
2221
+ # This API requires the Auth Role to be enabled.
2222
+ #
2223
+ # @param [String] target_user Selected username
2224
+ # @return [Array<Comet::BackupJobDetail>]
2225
+ def admin_get_jobs_for_user(target_user)
2226
+ submit_params = {}
2227
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
2228
+
2229
+ submit_params['TargetUser'] = target_user
2230
+
2231
+ body = perform_request('api/v1/admin/get-jobs-for-user', submit_params)
2232
+ json_body = JSON.parse body
2233
+ check_status json_body
2234
+ if json_body.nil?
2235
+ ret = []
2236
+ else
2237
+ ret = Array.new(json_body.length)
2238
+ json_body.each_with_index do |v, i|
2239
+ ret[i] = Comet::BackupJobDetail.new
2240
+ ret[i].from_hash(v)
2241
+ end
2242
+ end
2243
+ ret
2244
+ end
2245
+
2246
+ # AdminGetJobsRecent
2247
+ #
2248
+ # Get jobs (Recent and incomplete).
2249
+ # The jobs are returned in an unspecified order.
2250
+ #
2251
+ # You must supply administrator authentication credentials to use this API.
2252
+ # This API requires the Auth Role to be enabled.
2253
+ #
2254
+ # @return [Array<Comet::BackupJobDetail>]
2255
+ def admin_get_jobs_recent
2256
+ body = perform_request('api/v1/admin/get-jobs-recent')
2257
+ json_body = JSON.parse body
2258
+ check_status json_body
2259
+ if json_body.nil?
2260
+ ret = []
2261
+ else
2262
+ ret = Array.new(json_body.length)
2263
+ json_body.each_with_index do |v, i|
2264
+ ret[i] = Comet::BackupJobDetail.new
2265
+ ret[i].from_hash(v)
2266
+ end
2267
+ end
2268
+ ret
2269
+ end
2270
+
2271
+ # AdminGetUserProfile
2272
+ #
2273
+ # Get user account profile.
2274
+ #
2275
+ # You must supply administrator authentication credentials to use this API.
2276
+ # This API requires the Auth Role to be enabled.
2277
+ #
2278
+ # @param [String] target_user Selected account username
2279
+ # @return [Comet::UserProfileConfig]
2280
+ def admin_get_user_profile(target_user)
2281
+ submit_params = {}
2282
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
2283
+
2284
+ submit_params['TargetUser'] = target_user
2285
+
2286
+ body = perform_request('api/v1/admin/get-user-profile', submit_params)
2287
+ json_body = JSON.parse body
2288
+ check_status json_body
2289
+ ret = Comet::UserProfileConfig.new
2290
+ ret.from_hash(json_body)
2291
+ ret
2292
+ end
2293
+
2294
+ # AdminGetUserProfileAndHash
2295
+ #
2296
+ # Get user account profile (atomic).
2297
+ # The resulting hash parameter can be passed to the corresponding update API, to atomically ensure that no changes occur between get/set operations.
2298
+ # The hash format is not publicly documented and may change in a future server version. Use server APIs to retrieve current hash values.
2299
+ #
2300
+ # You must supply administrator authentication credentials to use this API.
2301
+ # This API requires the Auth Role to be enabled.
2302
+ #
2303
+ # @param [String] target_user Selected account username
2304
+ # @return [Comet::GetProfileAndHashResponseMessage]
2305
+ def admin_get_user_profile_and_hash(target_user)
2306
+ submit_params = {}
2307
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
2308
+
2309
+ submit_params['TargetUser'] = target_user
2310
+
2311
+ body = perform_request('api/v1/admin/get-user-profile-and-hash', submit_params)
2312
+ json_body = JSON.parse body
2313
+ check_status json_body
2314
+ ret = Comet::GetProfileAndHashResponseMessage.new
2315
+ ret.from_hash(json_body)
2316
+ ret
2317
+ end
2318
+
2319
+ # AdminGetUserProfileHash
2320
+ #
2321
+ # Get user account profile (hash).
2322
+ # The profile hash can be used to determine if a user account profile has changed.
2323
+ # The hash format is not publicly documented and may change in a future server version. Use server APIs to retrieve current hash values.
2324
+ #
2325
+ # You must supply administrator authentication credentials to use this API.
2326
+ # This API requires the Auth Role to be enabled.
2327
+ #
2328
+ # @param [String] target_user Selected account username
2329
+ # @return [Comet::GetProfileHashResponseMessage]
2330
+ def admin_get_user_profile_hash(target_user)
2331
+ submit_params = {}
2332
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
2333
+
2334
+ submit_params['TargetUser'] = target_user
2335
+
2336
+ body = perform_request('api/v1/admin/get-user-profile-hash', submit_params)
2337
+ json_body = JSON.parse body
2338
+ check_status json_body
2339
+ ret = Comet::GetProfileHashResponseMessage.new
2340
+ ret.from_hash(json_body)
2341
+ ret
2342
+ end
2343
+
2344
+ # AdminJobCancel
2345
+ #
2346
+ # Cancel a running job.
2347
+ # A request is sent to the live-connected device, asking it to cancel the operation. This may fail if there is no live-connection.
2348
+ # Only jobs from Comet 18.3.5 or newer can be cancelled. A job can only be cancelled if it has a non-empty CancellationID field in its properties.
2349
+ # If the device is running Comet 21.9.5 or later, this API will wait up to ten seconds for a confirmation from the client.
2350
+ #
2351
+ # You must supply administrator authentication credentials to use this API.
2352
+ # This API requires the Auth Role to be enabled.
2353
+ #
2354
+ # @param [String] target_user Username
2355
+ # @param [String] job_id Job ID
2356
+ # @return [Comet::CometAPIResponseMessage]
2357
+ def admin_job_cancel(target_user, job_id)
2358
+ submit_params = {}
2359
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
2360
+
2361
+ submit_params['TargetUser'] = target_user
2362
+ raise TypeError, "'job_id' expected String, got #{job_id.class}" unless job_id.is_a? String
2363
+
2364
+ submit_params['JobID'] = job_id
2365
+
2366
+ body = perform_request('api/v1/admin/job/cancel', submit_params)
2367
+ json_body = JSON.parse body
2368
+ check_status json_body
2369
+ ret = Comet::CometAPIResponseMessage.new
2370
+ ret.from_hash(json_body)
2371
+ ret
2372
+ end
2373
+
2374
+ # AdminListUsers
2375
+ #
2376
+ # List all user accounts.
2377
+ #
2378
+ # You must supply administrator authentication credentials to use this API.
2379
+ # This API requires the Auth Role to be enabled.
2380
+ #
2381
+ # @return [Array<String>]
2382
+ def admin_list_users
2383
+ body = perform_request('api/v1/admin/list-users')
2384
+ json_body = JSON.parse body
2385
+ check_status json_body
2386
+ if json_body.nil?
2387
+ ret = []
2388
+ else
2389
+ ret = Array.new(json_body.length)
2390
+ json_body.each_with_index do |v, i|
2391
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
2392
+
2393
+ ret[i] = v
2394
+ end
2395
+ end
2396
+ ret
2397
+ end
2398
+
2399
+ # AdminListUsersFull
2400
+ #
2401
+ # List all user account profiles.
2402
+ #
2403
+ # You must supply administrator authentication credentials to use this API.
2404
+ # This API requires the Auth Role to be enabled.
2405
+ #
2406
+ # @return [Hash{String => Comet::UserProfileConfig}]
2407
+ def admin_list_users_full
2408
+ body = perform_request('api/v1/admin/list-users-full')
2409
+ json_body = JSON.parse body
2410
+ check_status json_body
2411
+ ret = {}
2412
+ if json_body.nil?
2413
+ ret = {}
2414
+ else
2415
+ json_body.each do |k, v|
2416
+ ret[k] = Comet::UserProfileConfig.new
2417
+ ret[k].from_hash(v)
2418
+ end
2419
+ end
2420
+ ret
2421
+ end
2422
+
2423
+ # AdminMetaBrandingConfigGet
2424
+ #
2425
+ # Get Branding configuration.
2426
+ #
2427
+ # You must supply administrator authentication credentials to use this API.
2428
+ # Access to this API may be prevented on a per-administrator basis.
2429
+ #
2430
+ # @return [Comet::ServerConfigOptionsBrandingFragment]
2431
+ def admin_meta_branding_config_get
2432
+ body = perform_request('api/v1/admin/meta/branding-config/get')
2433
+ json_body = JSON.parse body
2434
+ check_status json_body
2435
+ ret = Comet::ServerConfigOptionsBrandingFragment.new
2436
+ ret.from_hash(json_body)
2437
+ ret
2438
+ end
2439
+
2440
+ # AdminMetaBrandingConfigSet
2441
+ #
2442
+ # Set Branding configuration.
2443
+ # Note that file resources must be provided using a resource URI I.E `"resource://05ba0b90ee66bda433169581188aba8d29faa938f9464cccd651a02fdf2e5b57"`. See AdminMetaResourceNew for the API documentation to create new file resources.
2444
+ #
2445
+ # You must supply administrator authentication credentials to use this API.
2446
+ # Access to this API may be prevented on a per-administrator basis.
2447
+ #
2448
+ # @param [Comet::BrandingOptions] branding_config Updated configuration content
2449
+ # @return [Comet::CometAPIResponseMessage]
2450
+ def admin_meta_branding_config_set(branding_config)
2451
+ submit_params = {}
2452
+ raise TypeError, "'branding_config' expected Comet::BrandingOptions, got #{branding_config.class}" unless branding_config.is_a? Comet::BrandingOptions
2453
+
2454
+ submit_params['BrandingConfig'] = branding_config.to_json
2455
+
2456
+ body = perform_request('api/v1/admin/meta/branding-config/set', submit_params)
2457
+ json_body = JSON.parse body
2458
+ check_status json_body
2459
+ ret = Comet::CometAPIResponseMessage.new
2460
+ ret.from_hash(json_body)
2461
+ ret
2462
+ end
2463
+
2464
+ # AdminMetaBuildConfigGet
2465
+ #
2466
+ # Get Software Build Role configuration.
2467
+ #
2468
+ # You must supply administrator authentication credentials to use this API.
2469
+ # Access to this API may be prevented on a per-administrator basis.
2470
+ #
2471
+ # @return [Comet::ServerConfigOptionsSoftwareBuildRoleFragment]
2472
+ def admin_meta_build_config_get
2473
+ body = perform_request('api/v1/admin/meta/build-config/get')
2474
+ json_body = JSON.parse body
2475
+ check_status json_body
2476
+ ret = Comet::ServerConfigOptionsSoftwareBuildRoleFragment.new
2477
+ ret.from_hash(json_body)
2478
+ ret
2479
+ end
2480
+
2481
+ # AdminMetaBuildConfigSet
2482
+ #
2483
+ # Set Build Role configuration.
2484
+ #
2485
+ # You must supply administrator authentication credentials to use this API.
2486
+ # Access to this API may be prevented on a per-administrator basis.
2487
+ #
2488
+ # @param [Comet::SoftwareBuildRoleOptions] software_build_role_config Updated configuration content
2489
+ # @return [Comet::CometAPIResponseMessage]
2490
+ def admin_meta_build_config_set(software_build_role_config)
2491
+ submit_params = {}
2492
+ raise TypeError, "'software_build_role_config' expected Comet::SoftwareBuildRoleOptions, got #{software_build_role_config.class}" unless software_build_role_config.is_a? Comet::SoftwareBuildRoleOptions
2493
+
2494
+ submit_params['SoftwareBuildRoleConfig'] = software_build_role_config.to_json
2495
+
2496
+ body = perform_request('api/v1/admin/meta/build-config/set', submit_params)
2497
+ json_body = JSON.parse body
2498
+ check_status json_body
2499
+ ret = Comet::CometAPIResponseMessage.new
2500
+ ret.from_hash(json_body)
2501
+ ret
2502
+ end
2503
+
2504
+ # AdminMetaListAvailableLogDays
2505
+ #
2506
+ # Get log files.
2507
+ #
2508
+ # You must supply administrator authentication credentials to use this API.
2509
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
2510
+ #
2511
+ # @return [Array<Number>]
2512
+ def admin_meta_list_available_log_days
2513
+ body = perform_request('api/v1/admin/meta/list-available-log-days')
2514
+ json_body = JSON.parse body
2515
+ check_status json_body
2516
+ if json_body.nil?
2517
+ ret = []
2518
+ else
2519
+ ret = Array.new(json_body.length)
2520
+ json_body.each_with_index do |v, i|
2521
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
2522
+
2523
+ ret[i] = v
2524
+ end
2525
+ end
2526
+ ret
2527
+ end
2528
+
2529
+ # AdminMetaReadAllLogs
2530
+ #
2531
+ # Get a ZIP file of all of the server's log files.
2532
+ # On non-Windows platforms, log content uses LF line endings. On Windows, Comet changed from LF to CRLF line endings in 18.3.2.
2533
+ # This API does not automatically convert line endings; around the 18.3.2 timeframe, log content may even contain mixed line-endings.
2534
+ #
2535
+ # You must supply administrator authentication credentials to use this API.
2536
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
2537
+ #
2538
+ # @return [String]
2539
+ def admin_meta_read_all_logs
2540
+ perform_request('api/v1/admin/meta/read-all-logs')
2541
+ end
2542
+
2543
+ # AdminMetaReadLogs
2544
+ #
2545
+ # Get log file content.
2546
+ # On non-Windows platforms, log content uses LF line endings. On Windows, Comet changed from LF to CRLF line endings in 18.3.2.
2547
+ # This API does not automatically convert line endings; around the 18.3.2 timeframe, log content may even contain mixed line-endings.
2548
+ #
2549
+ # You must supply administrator authentication credentials to use this API.
2550
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
2551
+ #
2552
+ # @param [Number] log A log day, selected from the options returned by the Get Log Files API
2553
+ # @return [String]
2554
+ def admin_meta_read_logs(log)
2555
+ submit_params = {}
2556
+ raise TypeError, "'log' expected Numeric, got #{log.class}" unless log.is_a? Numeric
2557
+
2558
+ submit_params['Log'] = log
2559
+
2560
+ perform_request('api/v1/admin/meta/read-logs', submit_params)
2561
+ end
2562
+
2563
+ # AdminMetaRemoteStorageVaultGet
2564
+ #
2565
+ # Get Requesting Remote Storage Vault Config.
2566
+ #
2567
+ # You must supply administrator authentication credentials to use this API.
2568
+ # Access to this API may be prevented on a per-administrator basis.
2569
+ #
2570
+ # @return [Array<Comet::RemoteStorageOption>]
2571
+ def admin_meta_remote_storage_vault_get
2572
+ body = perform_request('api/v1/admin/meta/remote-storage-vault/get')
2573
+ json_body = JSON.parse body
2574
+ check_status json_body
2575
+ if json_body.nil?
2576
+ ret = []
2577
+ else
2578
+ ret = Array.new(json_body.length)
2579
+ json_body.each_with_index do |v, i|
2580
+ ret[i] = Comet::RemoteStorageOption.new
2581
+ ret[i].from_hash(v)
2582
+ end
2583
+ end
2584
+ ret
2585
+ end
2586
+
2587
+ # AdminMetaRemoteStorageVaultSet
2588
+ #
2589
+ # Set Requestable Remote Storage Vault options.
2590
+ #
2591
+ # You must supply administrator authentication credentials to use this API.
2592
+ # Access to this API may be prevented on a per-administrator basis.
2593
+ #
2594
+ # @param [Array<Comet::RemoteStorageOption>] remote_storage_options Updated configuration content
2595
+ # @return [Comet::CometAPIResponseMessage]
2596
+ def admin_meta_remote_storage_vault_set(remote_storage_options)
2597
+ submit_params = {}
2598
+ raise TypeError, "'remote_storage_options' expected Array, got #{remote_storage_options.class}" unless remote_storage_options.is_a? Array
2599
+
2600
+ submit_params['RemoteStorageOptions'] = remote_storage_options.to_json
2601
+
2602
+ body = perform_request('api/v1/admin/meta/remote-storage-vault/set', submit_params)
2603
+ json_body = JSON.parse body
2604
+ check_status json_body
2605
+ ret = Comet::CometAPIResponseMessage.new
2606
+ ret.from_hash(json_body)
2607
+ ret
2608
+ end
2609
+
2610
+ # AdminMetaResourceGet
2611
+ #
2612
+ # Get a resource file.
2613
+ # Resources are used to upload files within the server configuration.
2614
+ #
2615
+ # You must supply administrator authentication credentials to use this API.
2616
+ #
2617
+ # @param [String] hash The resource identifier
2618
+ # @return [String]
2619
+ def admin_meta_resource_get(hash)
2620
+ submit_params = {}
2621
+ raise TypeError, "'hash' expected String, got #{hash.class}" unless hash.is_a? String
2622
+
2623
+ submit_params['Hash'] = hash
2624
+
2625
+ perform_request('api/v1/admin/meta/resource/get', submit_params)
2626
+ end
2627
+
2628
+ # AdminMetaResourceNew
2629
+ #
2630
+ # Upload a resource file.
2631
+ # Resources are used to upload files within the server configuration.
2632
+ # The resulting resource ID is autogenerated.
2633
+ # The lifespan of an uploaded resource is undefined. Resources may be deleted automatically, but it should remain available until the next call to AdminMetaServerConfigSet, and will remain available for as long as it is referenced by the server configuration.
2634
+ #
2635
+ # You must supply administrator authentication credentials to use this API.
2636
+ #
2637
+ # @param [String] upload The uploaded file contents, as a multipart/form-data part.
2638
+ # @return [Comet::AdminResourceResponse]
2639
+ def admin_meta_resource_new(upload)
2640
+ submit_params = {}
2641
+ raise TypeError, "'upload' expected String, got #{upload.class}" unless upload.is_a? String
2642
+
2643
+ submit_params['upload'] = upload
2644
+
2645
+ body = perform_request_multipart('api/v1/admin/meta/resource/new', submit_params)
2646
+ json_body = JSON.parse body
2647
+ check_status json_body
2648
+ ret = Comet::AdminResourceResponse.new
2649
+ ret.from_hash(json_body)
2650
+ ret
2651
+ end
2652
+
2653
+ # AdminMetaRestartService
2654
+ #
2655
+ # Restart server.
2656
+ # The Comet Server process will exit. The service manager should restart the server automatically.
2657
+ #
2658
+ # Prior to 18.9.2, this API terminated the server immediately without returning a response. In 18.9.2 and later, it returns a successful response before shutting down.
2659
+ #
2660
+ # You must supply administrator authentication credentials to use this API.
2661
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
2662
+ # Access to this API may be prevented on a per-administrator basis.
2663
+ #
2664
+ # @return [Comet::CometAPIResponseMessage]
2665
+ def admin_meta_restart_service
2666
+ body = perform_request('api/v1/admin/meta/restart-service')
2667
+ json_body = JSON.parse body
2668
+ check_status json_body
2669
+ ret = Comet::CometAPIResponseMessage.new
2670
+ ret.from_hash(json_body)
2671
+ ret
2672
+ end
2673
+
2674
+ # AdminMetaSendTestEmail
2675
+ #
2676
+ # Send a test email message.
2677
+ # This allows the Comet Server web interface to support testing different email credentials during setup.
2678
+ #
2679
+ # You must supply administrator authentication credentials to use this API.
2680
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
2681
+ # Access to this API may be prevented on a per-administrator basis.
2682
+ #
2683
+ # @param [Comet::EmailOptions] email_options Updated configuration content
2684
+ # @param [String] recipient Target email address to send test email
2685
+ # @return [Comet::CometAPIResponseMessage]
2686
+ def admin_meta_send_test_email(email_options, recipient)
2687
+ submit_params = {}
2688
+ raise TypeError, "'email_options' expected Comet::EmailOptions, got #{email_options.class}" unless email_options.is_a? Comet::EmailOptions
2689
+
2690
+ submit_params['EmailOptions'] = email_options.to_json
2691
+ raise TypeError, "'recipient' expected String, got #{recipient.class}" unless recipient.is_a? String
2692
+
2693
+ submit_params['Recipient'] = recipient
2694
+
2695
+ body = perform_request('api/v1/admin/meta/send-test-email', submit_params)
2696
+ json_body = JSON.parse body
2697
+ check_status json_body
2698
+ ret = Comet::CometAPIResponseMessage.new
2699
+ ret.from_hash(json_body)
2700
+ ret
2701
+ end
2702
+
2703
+ # AdminMetaServerConfigGet
2704
+ #
2705
+ # Get server configuration.
2706
+ #
2707
+ # You must supply administrator authentication credentials to use this API.
2708
+ # Access to this API may be prevented on a per-administrator basis.
2709
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
2710
+ #
2711
+ # @return [Comet::ServerConfigOptions]
2712
+ def admin_meta_server_config_get
2713
+ body = perform_request('api/v1/admin/meta/server-config/get')
2714
+ json_body = JSON.parse body
2715
+ check_status json_body
2716
+ ret = Comet::ServerConfigOptions.new
2717
+ ret.from_hash(json_body)
2718
+ ret
2719
+ end
2720
+
2721
+ # AdminMetaServerConfigNetworkInterfaces
2722
+ #
2723
+ # List the available network interfaces on the PC running Comet Server.
2724
+ # Any IPv6 addresses are listed in compressed form without square-brackets.
2725
+ #
2726
+ # You must supply administrator authentication credentials to use this API.
2727
+ # Access to this API may be prevented on a per-administrator basis.
2728
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
2729
+ #
2730
+ # @return [Array<String>]
2731
+ def admin_meta_server_config_network_interfaces
2732
+ body = perform_request('api/v1/admin/meta/server-config/network-interfaces')
2733
+ json_body = JSON.parse body
2734
+ check_status json_body
2735
+ if json_body.nil?
2736
+ ret = []
2737
+ else
2738
+ ret = Array.new(json_body.length)
2739
+ json_body.each_with_index do |v, i|
2740
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
2741
+
2742
+ ret[i] = v
2743
+ end
2744
+ end
2745
+ ret
2746
+ end
2747
+
2748
+ # AdminMetaServerConfigSet
2749
+ #
2750
+ # Set server configuration.
2751
+ # The Comet Server process will exit. The service manager should restart the server automatically.
2752
+ #
2753
+ # Prior to 18.9.2, this API terminated the server immediately without returning a response. In 18.9.2 and later, it returns a successful response before shutting down.
2754
+ #
2755
+ # You must supply administrator authentication credentials to use this API.
2756
+ # Access to this API may be prevented on a per-administrator basis.
2757
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
2758
+ #
2759
+ # @param [Comet::ServerConfigOptions] config Updated configuration content
2760
+ # @return [Comet::CometAPIResponseMessage]
2761
+ def admin_meta_server_config_set(config)
2762
+ submit_params = {}
2763
+ raise TypeError, "'config' expected Comet::ServerConfigOptions, got #{config.class}" unless config.is_a? Comet::ServerConfigOptions
2764
+
2765
+ submit_params['Config'] = config.to_json
2766
+
2767
+ body = perform_request('api/v1/admin/meta/server-config/set', submit_params)
2768
+ json_body = JSON.parse body
2769
+ check_status json_body
2770
+ ret = Comet::CometAPIResponseMessage.new
2771
+ ret.from_hash(json_body)
2772
+ ret
2773
+ end
2774
+
2775
+ # AdminMetaShutdownService
2776
+ #
2777
+ # Shut down server.
2778
+ # The Comet Server process will exit.
2779
+ #
2780
+ # Prior to 18.9.2, this API terminated the server immediately without returning a response. In 18.9.2 and later, it returns a successful response before shutting down.
2781
+ #
2782
+ # You must supply administrator authentication credentials to use this API.
2783
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
2784
+ # Access to this API may be prevented on a per-administrator basis.
2785
+ #
2786
+ # @return [Comet::CometAPIResponseMessage]
2787
+ def admin_meta_shutdown_service
2788
+ body = perform_request('api/v1/admin/meta/shutdown-service')
2789
+ json_body = JSON.parse body
2790
+ check_status json_body
2791
+ ret = Comet::CometAPIResponseMessage.new
2792
+ ret.from_hash(json_body)
2793
+ ret
2794
+ end
2795
+
2796
+ # AdminMetaSoftwareUpdateNews
2797
+ #
2798
+ # Get software update news from the software provider.
2799
+ #
2800
+ # You must supply administrator authentication credentials to use this API.
2801
+ #
2802
+ # @return [Comet::SoftwareUpdateNewsResponse]
2803
+ def admin_meta_software_update_news
2804
+ body = perform_request('api/v1/admin/meta/software-update-news')
2805
+ json_body = JSON.parse body
2806
+ check_status json_body
2807
+ ret = Comet::SoftwareUpdateNewsResponse.new
2808
+ ret.from_hash(json_body)
2809
+ ret
2810
+ end
2811
+
2812
+ # AdminMetaStats
2813
+ #
2814
+ # Get Comet Server historical statistics.
2815
+ # The returned key-value map is not necessarily ordered. Client-side code should sort the result before display.
2816
+ #
2817
+ # You must supply administrator authentication credentials to use this API.
2818
+ #
2819
+ # @param [Boolean] simple Remove redundant statistics
2820
+ # @return [Hash{Number => Comet::StatResult}]
2821
+ def admin_meta_stats(simple)
2822
+ submit_params = {}
2823
+ submit_params['Simple'] = (simple ? 1 : 0)
2824
+
2825
+ body = perform_request('api/v1/admin/meta/stats', submit_params)
2826
+ json_body = JSON.parse body
2827
+ check_status json_body
2828
+ ret = {}
2829
+ if json_body.nil?
2830
+ ret = {}
2831
+ else
2832
+ json_body.each do |k, v|
2833
+ ret[k] = Comet::StatResult.new
2834
+ ret[k].from_hash(v)
2835
+ end
2836
+ end
2837
+ ret
2838
+ end
2839
+
2840
+ # AdminMetaVersion
2841
+ #
2842
+ # Get server properties.
2843
+ # Retrieve the version number and basic properties about the server.
2844
+ #
2845
+ # You must supply administrator authentication credentials to use this API.
2846
+ #
2847
+ # @return [Comet::ServerMetaVersionInfo]
2848
+ def admin_meta_version
2849
+ body = perform_request('api/v1/admin/meta/version')
2850
+ json_body = JSON.parse body
2851
+ check_status json_body
2852
+ ret = Comet::ServerMetaVersionInfo.new
2853
+ ret.from_hash(json_body)
2854
+ ret
2855
+ end
2856
+
2857
+ # AdminMetaWebhookOptionsGet
2858
+ #
2859
+ # Get the server webhook configuration.
2860
+ #
2861
+ # You must supply administrator authentication credentials to use this API.
2862
+ #
2863
+ # @return [Hash{String => Comet::WebhookOption}]
2864
+ def admin_meta_webhook_options_get
2865
+ body = perform_request('api/v1/admin/meta/webhook-options/get')
2866
+ json_body = JSON.parse body
2867
+ check_status json_body
2868
+ ret = {}
2869
+ if json_body.nil?
2870
+ ret = {}
2871
+ else
2872
+ json_body.each do |k, v|
2873
+ ret[k] = Comet::WebhookOption.new
2874
+ ret[k].from_hash(v)
2875
+ end
2876
+ end
2877
+ ret
2878
+ end
2879
+
2880
+ # AdminMetaWebhookOptionsSet
2881
+ #
2882
+ # Update the server webhook configuration.
2883
+ # Calling this endpoint will interrupt any messages currently queued for existing webhook destinations.
2884
+ #
2885
+ # You must supply administrator authentication credentials to use this API.
2886
+ #
2887
+ # @param [Hash{String => Comet::WebhookOption}] webhook_options The replacement webhook target options.
2888
+ # @return [Comet::CometAPIResponseMessage]
2889
+ def admin_meta_webhook_options_set(webhook_options)
2890
+ submit_params = {}
2891
+ raise TypeError, "'webhook_options' expected Hash, got #{webhook_options.class}" unless webhook_options.is_a? Hash
2892
+
2893
+ submit_params['WebhookOptions'] = webhook_options.to_json
2894
+
2895
+ body = perform_request('api/v1/admin/meta/webhook-options/set', submit_params)
2896
+ json_body = JSON.parse body
2897
+ check_status json_body
2898
+ ret = Comet::CometAPIResponseMessage.new
2899
+ ret.from_hash(json_body)
2900
+ ret
2901
+ end
2902
+
2903
+ # AdminNewsGetAll
2904
+ #
2905
+ # Get News entries (Admin).
2906
+ #
2907
+ # You must supply administrator authentication credentials to use this API.
2908
+ # This API requires the Auth Role to be enabled.
2909
+ #
2910
+ # @return [Hash{String => Comet::NewsEntry}]
2911
+ def admin_news_get_all
2912
+ body = perform_request('api/v1/admin/news/get-all')
2913
+ json_body = JSON.parse body
2914
+ check_status json_body
2915
+ ret = {}
2916
+ if json_body.nil?
2917
+ ret = {}
2918
+ else
2919
+ json_body.each do |k, v|
2920
+ ret[k] = Comet::NewsEntry.new
2921
+ ret[k].from_hash(v)
2922
+ end
2923
+ end
2924
+ ret
2925
+ end
2926
+
2927
+ # AdminNewsRemove
2928
+ #
2929
+ # Remove news item.
2930
+ #
2931
+ # You must supply administrator authentication credentials to use this API.
2932
+ # This API requires the Auth Role to be enabled.
2933
+ #
2934
+ # @param [String] news_item Selected news item GUID
2935
+ # @return [Comet::CometAPIResponseMessage]
2936
+ def admin_news_remove(news_item)
2937
+ submit_params = {}
2938
+ raise TypeError, "'news_item' expected String, got #{news_item.class}" unless news_item.is_a? String
2939
+
2940
+ submit_params['NewsItem'] = news_item
2941
+
2942
+ body = perform_request('api/v1/admin/news/remove', submit_params)
2943
+ json_body = JSON.parse body
2944
+ check_status json_body
2945
+ ret = Comet::CometAPIResponseMessage.new
2946
+ ret.from_hash(json_body)
2947
+ ret
2948
+ end
2949
+
2950
+ # AdminNewsSubmit
2951
+ #
2952
+ # Submit news item.
2953
+ #
2954
+ # You must supply administrator authentication credentials to use this API.
2955
+ # This API requires the Auth Role to be enabled.
2956
+ #
2957
+ # @param [String] news_content Content of news item
2958
+ # @return [Comet::CometAPIResponseMessage]
2959
+ def admin_news_submit(news_content)
2960
+ submit_params = {}
2961
+ raise TypeError, "'news_content' expected String, got #{news_content.class}" unless news_content.is_a? String
2962
+
2963
+ submit_params['NewsContent'] = news_content
2964
+
2965
+ body = perform_request('api/v1/admin/news/submit', submit_params)
2966
+ json_body = JSON.parse body
2967
+ check_status json_body
2968
+ ret = Comet::CometAPIResponseMessage.new
2969
+ ret.from_hash(json_body)
2970
+ ret
2971
+ end
2972
+
2973
+ # AdminOrganizationDelete
2974
+ #
2975
+ # Delete an organization and all related users.
2976
+ #
2977
+ # You must supply administrator authentication credentials to use this API.
2978
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
2979
+ #
2980
+ # @param [String] organization_id (Optional) (No description available)
2981
+ # @param [Comet::UninstallConfig] uninstall_config (Optional) Uninstall software configuration
2982
+ # @return [Comet::OrganizationResponse]
2983
+ def admin_organization_delete(organization_id = nil, uninstall_config = nil)
2984
+ submit_params = {}
2985
+ unless organization_id.nil?
2986
+ raise TypeError, "'organization_id' expected String, got #{organization_id.class}" unless organization_id.is_a? String
2987
+
2988
+ submit_params['OrganizationID'] = organization_id
2989
+ end
2990
+ unless uninstall_config.nil?
2991
+ raise TypeError, "'uninstall_config' expected Comet::UninstallConfig, got #{uninstall_config.class}" unless uninstall_config.is_a? Comet::UninstallConfig
2992
+
2993
+ submit_params['UninstallConfig'] = uninstall_config.to_json
2994
+ end
2995
+
2996
+ body = perform_request('api/v1/admin/organization/delete', submit_params)
2997
+ json_body = JSON.parse body
2998
+ check_status json_body
2999
+ ret = Comet::OrganizationResponse.new
3000
+ ret.from_hash(json_body)
3001
+ ret
3002
+ end
3003
+
3004
+ # AdminOrganizationList
3005
+ #
3006
+ # List Organizations.
3007
+ #
3008
+ # You must supply administrator authentication credentials to use this API.
3009
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
3010
+ #
3011
+ # @return [Hash{String => Comet::Organization}]
3012
+ def admin_organization_list
3013
+ body = perform_request('api/v1/admin/organization/list')
3014
+ json_body = JSON.parse body
3015
+ check_status json_body
3016
+ ret = {}
3017
+ if json_body.nil?
3018
+ ret = {}
3019
+ else
3020
+ json_body.each do |k, v|
3021
+ ret[k] = Comet::Organization.new
3022
+ ret[k].from_hash(v)
3023
+ end
3024
+ end
3025
+ ret
3026
+ end
3027
+
3028
+ # AdminOrganizationSet
3029
+ #
3030
+ # Create or Update an Organization.
3031
+ #
3032
+ # You must supply administrator authentication credentials to use this API.
3033
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
3034
+ #
3035
+ # @param [String] organization_id (Optional) (No description available)
3036
+ # @param [Comet::Organization] organization (Optional) (No description available)
3037
+ # @return [Comet::OrganizationResponse]
3038
+ def admin_organization_set(organization_id = nil, organization = nil)
3039
+ submit_params = {}
3040
+ unless organization_id.nil?
3041
+ raise TypeError, "'organization_id' expected String, got #{organization_id.class}" unless organization_id.is_a? String
3042
+
3043
+ submit_params['OrganizationID'] = organization_id
3044
+ end
3045
+ unless organization.nil?
3046
+ raise TypeError, "'organization' expected Comet::Organization, got #{organization.class}" unless organization.is_a? Comet::Organization
3047
+
3048
+ submit_params['Organization'] = organization.to_json
3049
+ end
3050
+
3051
+ body = perform_request('api/v1/admin/organization/set', submit_params)
3052
+ json_body = JSON.parse body
3053
+ check_status json_body
3054
+ ret = Comet::OrganizationResponse.new
3055
+ ret.from_hash(json_body)
3056
+ ret
3057
+ end
3058
+
3059
+ # AdminPoliciesDelete
3060
+ #
3061
+ # Delete an existing policy object.
3062
+ #
3063
+ # You must supply administrator authentication credentials to use this API.
3064
+ # This API requires the Auth Role to be enabled.
3065
+ #
3066
+ # @param [String] policy_id The policy ID to update or create
3067
+ # @return [Comet::CometAPIResponseMessage]
3068
+ def admin_policies_delete(policy_id)
3069
+ submit_params = {}
3070
+ raise TypeError, "'policy_id' expected String, got #{policy_id.class}" unless policy_id.is_a? String
3071
+
3072
+ submit_params['PolicyID'] = policy_id
3073
+
3074
+ body = perform_request('api/v1/admin/policies/delete', submit_params)
3075
+ json_body = JSON.parse body
3076
+ check_status json_body
3077
+ ret = Comet::CometAPIResponseMessage.new
3078
+ ret.from_hash(json_body)
3079
+ ret
3080
+ end
3081
+
3082
+ # AdminPoliciesGet
3083
+ #
3084
+ # Retrieve a single policy object.
3085
+ # A hash is also returned, to allow atomic modification operations.
3086
+ #
3087
+ # You must supply administrator authentication credentials to use this API.
3088
+ # This API requires the Auth Role to be enabled.
3089
+ #
3090
+ # @param [String] policy_id The policy ID to retrieve
3091
+ # @return [Comet::GetGroupPolicyResponse]
3092
+ def admin_policies_get(policy_id)
3093
+ submit_params = {}
3094
+ raise TypeError, "'policy_id' expected String, got #{policy_id.class}" unless policy_id.is_a? String
3095
+
3096
+ submit_params['PolicyID'] = policy_id
3097
+
3098
+ body = perform_request('api/v1/admin/policies/get', submit_params)
3099
+ json_body = JSON.parse body
3100
+ check_status json_body
3101
+ ret = Comet::GetGroupPolicyResponse.new
3102
+ ret.from_hash(json_body)
3103
+ ret
3104
+ end
3105
+
3106
+ # AdminPoliciesList
3107
+ #
3108
+ # List all policy object names.
3109
+ #
3110
+ # You must supply administrator authentication credentials to use this API.
3111
+ # This API requires the Auth Role to be enabled.
3112
+ #
3113
+ # @return [Hash{String => String}]
3114
+ def admin_policies_list
3115
+ body = perform_request('api/v1/admin/policies/list')
3116
+ json_body = JSON.parse body
3117
+ check_status json_body
3118
+ ret = {}
3119
+ if json_body.nil?
3120
+ ret = {}
3121
+ else
3122
+ json_body.each do |k, v|
3123
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
3124
+
3125
+ ret[k] = v
3126
+ end
3127
+ end
3128
+ ret
3129
+ end
3130
+
3131
+ # AdminPoliciesListFull
3132
+ #
3133
+ # Get all policy objects.
3134
+ #
3135
+ # You must supply administrator authentication credentials to use this API.
3136
+ # This API requires the Auth Role to be enabled.
3137
+ #
3138
+ # @return [Hash{String => Comet::GroupPolicy}]
3139
+ def admin_policies_list_full
3140
+ body = perform_request('api/v1/admin/policies/list-full')
3141
+ json_body = JSON.parse body
3142
+ check_status json_body
3143
+ ret = {}
3144
+ if json_body.nil?
3145
+ ret = {}
3146
+ else
3147
+ json_body.each do |k, v|
3148
+ ret[k] = Comet::GroupPolicy.new
3149
+ ret[k].from_hash(v)
3150
+ end
3151
+ end
3152
+ ret
3153
+ end
3154
+
3155
+ # AdminPoliciesNew
3156
+ #
3157
+ # Create a new policy object.
3158
+ #
3159
+ # You must supply administrator authentication credentials to use this API.
3160
+ # This API requires the Auth Role to be enabled.
3161
+ #
3162
+ # @param [Comet::GroupPolicy] policy The policy data
3163
+ # @return [Comet::CreateGroupPolicyResponse]
3164
+ def admin_policies_new(policy)
3165
+ submit_params = {}
3166
+ raise TypeError, "'policy' expected Comet::GroupPolicy, got #{policy.class}" unless policy.is_a? Comet::GroupPolicy
3167
+
3168
+ submit_params['Policy'] = policy.to_json
3169
+
3170
+ body = perform_request('api/v1/admin/policies/new', submit_params)
3171
+ json_body = JSON.parse body
3172
+ check_status json_body
3173
+ ret = Comet::CreateGroupPolicyResponse.new
3174
+ ret.from_hash(json_body)
3175
+ ret
3176
+ end
3177
+
3178
+ # AdminPoliciesSet
3179
+ #
3180
+ # Update an existing policy object.
3181
+ # An optional hash may be used, to ensure the modification was atomic.
3182
+ # This API can also be used to create a new policy object with a specific hash.
3183
+ #
3184
+ # You must supply administrator authentication credentials to use this API.
3185
+ # This API requires the Auth Role to be enabled.
3186
+ #
3187
+ # @param [String] policy_id The policy ID to update or create
3188
+ # @param [Comet::GroupPolicy] policy The policy data
3189
+ # @param [String] check_policy_hash (Optional) An atomic verification hash as supplied by the AdminPoliciesGet API
3190
+ # @return [Comet::CometAPIResponseMessage]
3191
+ def admin_policies_set(policy_id, policy, check_policy_hash = nil)
3192
+ submit_params = {}
3193
+ raise TypeError, "'policy_id' expected String, got #{policy_id.class}" unless policy_id.is_a? String
3194
+
3195
+ submit_params['PolicyID'] = policy_id
3196
+ raise TypeError, "'policy' expected Comet::GroupPolicy, got #{policy.class}" unless policy.is_a? Comet::GroupPolicy
3197
+
3198
+ submit_params['Policy'] = policy.to_json
3199
+ unless check_policy_hash.nil?
3200
+ raise TypeError, "'check_policy_hash' expected String, got #{check_policy_hash.class}" unless check_policy_hash.is_a? String
3201
+
3202
+ submit_params['CheckPolicyHash'] = check_policy_hash
3203
+ end
3204
+
3205
+ body = perform_request('api/v1/admin/policies/set', submit_params)
3206
+ json_body = JSON.parse body
3207
+ check_status json_body
3208
+ ret = Comet::CometAPIResponseMessage.new
3209
+ ret.from_hash(json_body)
3210
+ ret
3211
+ end
3212
+
3213
+ # AdminPreviewUserEmailReport
3214
+ #
3215
+ # Preview an email report for a customer.
3216
+ #
3217
+ # You must supply administrator authentication credentials to use this API.
3218
+ # This API requires the Auth Role to be enabled.
3219
+ #
3220
+ # @param [String] target_user Selected account username
3221
+ # @param [Comet::EmailReportConfig] email_report_config Email report configuration to preview
3222
+ # @param [String] email_address (Optional) Email address that may be included in the report body (>= 20.3.3)
3223
+ # @return [Comet::EmailReportGeneratedPreview]
3224
+ def admin_preview_user_email_report(target_user, email_report_config, email_address = nil)
3225
+ submit_params = {}
3226
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
3227
+
3228
+ submit_params['TargetUser'] = target_user
3229
+ raise TypeError, "'email_report_config' expected Comet::EmailReportConfig, got #{email_report_config.class}" unless email_report_config.is_a? Comet::EmailReportConfig
3230
+
3231
+ submit_params['EmailReportConfig'] = email_report_config.to_json
3232
+ unless email_address.nil?
3233
+ raise TypeError, "'email_address' expected String, got #{email_address.class}" unless email_address.is_a? String
3234
+
3235
+ submit_params['EmailAddress'] = email_address
3236
+ end
3237
+
3238
+ body = perform_request('api/v1/admin/preview-user-email-report', submit_params)
3239
+ json_body = JSON.parse body
3240
+ check_status json_body
3241
+ ret = Comet::EmailReportGeneratedPreview.new
3242
+ ret.from_hash(json_body)
3243
+ ret
3244
+ end
3245
+
3246
+ # AdminReplicationState
3247
+ #
3248
+ # Get Replication status.
3249
+ #
3250
+ # You must supply administrator authentication credentials to use this API.
3251
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
3252
+ #
3253
+ # @return [Array<Comet::ReplicatorStateAPIResponse>]
3254
+ def admin_replication_state
3255
+ body = perform_request('api/v1/admin/replication/state')
3256
+ json_body = JSON.parse body
3257
+ check_status json_body
3258
+ if json_body.nil?
3259
+ ret = []
3260
+ else
3261
+ ret = Array.new(json_body.length)
3262
+ json_body.each_with_index do |v, i|
3263
+ ret[i] = Comet::ReplicatorStateAPIResponse.new
3264
+ ret[i].from_hash(v)
3265
+ end
3266
+ end
3267
+ ret
3268
+ end
3269
+
3270
+ # AdminRequestStorageVault
3271
+ #
3272
+ # Request a new Storage Vault on behalf of a user.
3273
+ # This action does not respect the "Prevent creating new Storage Vaults (via Request)" policy setting. New Storage Vaults can be requested regardless of the policy setting.
3274
+ # Prior to Comet 19.8.0, the response type was CometAPIResponseMessage (i.e. no DestinationID field in response).
3275
+ #
3276
+ # You must supply administrator authentication credentials to use this API.
3277
+ # This API requires the Auth Role to be enabled.
3278
+ #
3279
+ # @param [String] target_user The user to receive the new Storage Vault
3280
+ # @param [String] storage_provider ID for the Requestable destination
3281
+ # @param [String] self_address (Optional) The external URL for this server. Used to resolve conflicts
3282
+ # @return [Comet::RequestStorageVaultResponseMessage]
3283
+ def admin_request_storage_vault(target_user, storage_provider, self_address = nil)
3284
+ submit_params = {}
3285
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
3286
+
3287
+ submit_params['TargetUser'] = target_user
3288
+ raise TypeError, "'storage_provider' expected String, got #{storage_provider.class}" unless storage_provider.is_a? String
3289
+
3290
+ submit_params['StorageProvider'] = storage_provider
3291
+ if self_address.nil?
3292
+ submit_params['SelfAddress'] = @server_address
3293
+ else
3294
+ raise TypeError, "'self_address' expected String, got #{self_address.class}" unless self_address.is_a? String
3295
+
3296
+ submit_params['SelfAddress'] = self_address
3297
+ end
3298
+
3299
+ body = perform_request('api/v1/admin/request-storage-vault', submit_params)
3300
+ json_body = JSON.parse body
3301
+ check_status json_body
3302
+ ret = Comet::RequestStorageVaultResponseMessage.new
3303
+ ret.from_hash(json_body)
3304
+ ret
3305
+ end
3306
+
3307
+ # AdminRequestStorageVaultProviders
3308
+ #
3309
+ # Get the available options for Requesting a Storage Vault.
3310
+ #
3311
+ # You must supply administrator authentication credentials to use this API.
3312
+ # This API requires the Auth Role to be enabled.
3313
+ #
3314
+ # @return [Hash{String => String}]
3315
+ def admin_request_storage_vault_providers
3316
+ body = perform_request('api/v1/admin/request-storage-vault-providers')
3317
+ json_body = JSON.parse body
3318
+ check_status json_body
3319
+ ret = {}
3320
+ if json_body.nil?
3321
+ ret = {}
3322
+ else
3323
+ json_body.each do |k, v|
3324
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
3325
+
3326
+ ret[k] = v
3327
+ end
3328
+ end
3329
+ ret
3330
+ end
3331
+
3332
+ # AdminResetUserPassword
3333
+ #
3334
+ # Reset user account password.
3335
+ # The user account must have a recovery code present. A new replacement recovery code will be generated automatically.
3336
+ #
3337
+ # You must supply administrator authentication credentials to use this API.
3338
+ # This API requires the Auth Role to be enabled.
3339
+ #
3340
+ # @param [String] target_user Selected account username
3341
+ # @param [String] new_password New account password
3342
+ # @param [String] old_password Old account password (optional)
3343
+ # @return [Comet::CometAPIResponseMessage]
3344
+ def admin_reset_user_password(target_user, new_password, old_password)
3345
+ submit_params = {}
3346
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
3347
+
3348
+ submit_params['TargetUser'] = target_user
3349
+ raise TypeError, "'new_password' expected String, got #{new_password.class}" unless new_password.is_a? String
3350
+
3351
+ submit_params['NewPassword'] = new_password
3352
+ raise TypeError, "'old_password' expected String, got #{old_password.class}" unless old_password.is_a? String
3353
+
3354
+ submit_params['OldPassword'] = old_password
3355
+
3356
+ body = perform_request('api/v1/admin/reset-user-password', submit_params)
3357
+ json_body = JSON.parse body
3358
+ check_status json_body
3359
+ ret = Comet::CometAPIResponseMessage.new
3360
+ ret.from_hash(json_body)
3361
+ ret
3362
+ end
3363
+
3364
+ # AdminRevokeDevice
3365
+ #
3366
+ # Revoke device from user account.
3367
+ # It's possible to simply remove the Device section from the user's profile, however, using this dedicated API will also gracefully handle live connections.
3368
+ #
3369
+ # You must supply administrator authentication credentials to use this API.
3370
+ # This API requires the Auth Role to be enabled.
3371
+ #
3372
+ # @param [String] target_user Selected account username
3373
+ # @param [String] target_device Selected Device ID
3374
+ # @return [Comet::CometAPIResponseMessage]
3375
+ def admin_revoke_device(target_user, target_device)
3376
+ submit_params = {}
3377
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
3378
+
3379
+ submit_params['TargetUser'] = target_user
3380
+ raise TypeError, "'target_device' expected String, got #{target_device.class}" unless target_device.is_a? String
3381
+
3382
+ submit_params['TargetDevice'] = target_device
3383
+
3384
+ body = perform_request('api/v1/admin/revoke-device', submit_params)
3385
+ json_body = JSON.parse body
3386
+ check_status json_body
3387
+ ret = Comet::CometAPIResponseMessage.new
3388
+ ret.from_hash(json_body)
3389
+ ret
3390
+ end
3391
+
3392
+ # AdminSetUserProfile
3393
+ #
3394
+ # Modify user account profile.
3395
+ #
3396
+ # You must supply administrator authentication credentials to use this API.
3397
+ # This API requires the Auth Role to be enabled.
3398
+ #
3399
+ # @param [String] target_user Selected account username
3400
+ # @param [Comet::UserProfileConfig] profile_data Modified user profile
3401
+ # @return [Comet::CometAPIResponseMessage]
3402
+ def admin_set_user_profile(target_user, profile_data)
3403
+ submit_params = {}
3404
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
3405
+
3406
+ submit_params['TargetUser'] = target_user
3407
+ raise TypeError, "'profile_data' expected Comet::UserProfileConfig, got #{profile_data.class}" unless profile_data.is_a? Comet::UserProfileConfig
3408
+
3409
+ submit_params['ProfileData'] = profile_data.to_json
3410
+
3411
+ body = perform_request('api/v1/admin/set-user-profile', submit_params)
3412
+ json_body = JSON.parse body
3413
+ check_status json_body
3414
+ ret = Comet::CometAPIResponseMessage.new
3415
+ ret.from_hash(json_body)
3416
+ ret
3417
+ end
3418
+
3419
+ # AdminSetUserProfileHash
3420
+ #
3421
+ # Modify user account profile (atomic).
3422
+ # The hash parameter can be determined from the corresponding API, to atomically ensure that no changes occur between get/set operations.
3423
+ # The hash format is not publicly documented and may change in a future server version. Use server APIs to retrieve current hash values.
3424
+ #
3425
+ # You must supply administrator authentication credentials to use this API.
3426
+ # This API requires the Auth Role to be enabled.
3427
+ #
3428
+ # @param [String] target_user Selected account username
3429
+ # @param [Comet::UserProfileConfig] profile_data Modified user profile
3430
+ # @param [String] require_hash Previous hash parameter
3431
+ # @return [Comet::CometAPIResponseMessage]
3432
+ def admin_set_user_profile_hash(target_user, profile_data, require_hash)
3433
+ submit_params = {}
3434
+ raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
3435
+
3436
+ submit_params['TargetUser'] = target_user
3437
+ raise TypeError, "'profile_data' expected Comet::UserProfileConfig, got #{profile_data.class}" unless profile_data.is_a? Comet::UserProfileConfig
3438
+
3439
+ submit_params['ProfileData'] = profile_data.to_json
3440
+ raise TypeError, "'require_hash' expected String, got #{require_hash.class}" unless require_hash.is_a? String
3441
+
3442
+ submit_params['RequireHash'] = require_hash
3443
+
3444
+ body = perform_request('api/v1/admin/set-user-profile-hash', submit_params)
3445
+ json_body = JSON.parse body
3446
+ check_status json_body
3447
+ ret = Comet::CometAPIResponseMessage.new
3448
+ ret.from_hash(json_body)
3449
+ ret
3450
+ end
3451
+
3452
+ # AdminStorageBucketProperties
3453
+ #
3454
+ # Retrieve properties for a single bucket.
3455
+ # This API can also be used to refresh the size measurement for a single bucket by passing a valid AfterTimestamp parameter.
3456
+ #
3457
+ # You must supply administrator authentication credentials to use this API.
3458
+ # This API requires the Storage Role to be enabled.
3459
+ #
3460
+ # @param [String] bucket_id Bucket ID
3461
+ # @param [Number] after_timestamp (Optional) Allow a stale size measurement if it is at least as new as the supplied Unix timestamp. Timestamps in the future may produce a result clamped down to the Comet Server's current time. If not present, the size measurement may be arbitrarily stale.
3462
+ # @return [Comet::BucketProperties]
3463
+ def admin_storage_bucket_properties(bucket_id, after_timestamp = nil)
3464
+ submit_params = {}
3465
+ raise TypeError, "'bucket_id' expected String, got #{bucket_id.class}" unless bucket_id.is_a? String
3466
+
3467
+ submit_params['BucketID'] = bucket_id
3468
+ unless after_timestamp.nil?
3469
+ raise TypeError, "'after_timestamp' expected Numeric, got #{after_timestamp.class}" unless after_timestamp.is_a? Numeric
3470
+
3471
+ submit_params['AfterTimestamp'] = after_timestamp
3472
+ end
3473
+
3474
+ body = perform_request('api/v1/admin/storage/bucket-properties', submit_params)
3475
+ json_body = JSON.parse body
3476
+ check_status json_body
3477
+ ret = Comet::BucketProperties.new
3478
+ ret.from_hash(json_body)
3479
+ ret
3480
+ end
3481
+
3482
+ # AdminStorageDeleteBucket
3483
+ #
3484
+ # Delete a bucket.
3485
+ # All data will be removed from the server. Misuse can cause data loss!
3486
+ #
3487
+ # You must supply administrator authentication credentials to use this API.
3488
+ # This API requires the Storage Role to be enabled.
3489
+ #
3490
+ # @param [String] bucket_id Selected bucket name
3491
+ # @return [Comet::CometAPIResponseMessage]
3492
+ def admin_storage_delete_bucket(bucket_id)
3493
+ submit_params = {}
3494
+ raise TypeError, "'bucket_id' expected String, got #{bucket_id.class}" unless bucket_id.is_a? String
3495
+
3496
+ submit_params['BucketID'] = bucket_id
3497
+
3498
+ body = perform_request('api/v1/admin/storage/delete-bucket', submit_params)
3499
+ json_body = JSON.parse body
3500
+ check_status json_body
3501
+ ret = Comet::CometAPIResponseMessage.new
3502
+ ret.from_hash(json_body)
3503
+ ret
3504
+ end
3505
+
3506
+ # AdminStorageFreeSpace
3507
+ #
3508
+ # Retrieve available space metrics.
3509
+ #
3510
+ # You must supply administrator authentication credentials to use this API.
3511
+ # Access to this API may be prevented on a per-administrator basis.
3512
+ # This API requires the Storage Role to be enabled.
3513
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
3514
+ #
3515
+ # @param [String] bucket_id (Optional) (This parameter is not used)
3516
+ # @return [Comet::StorageFreeSpaceInfo]
3517
+ def admin_storage_free_space(bucket_id = nil)
3518
+ submit_params = {}
3519
+ unless bucket_id.nil?
3520
+ raise TypeError, "'bucket_id' expected String, got #{bucket_id.class}" unless bucket_id.is_a? String
3521
+
3522
+ submit_params['BucketID'] = bucket_id
3523
+ end
3524
+
3525
+ body = perform_request('api/v1/admin/storage/free-space', submit_params)
3526
+ json_body = JSON.parse body
3527
+ check_status json_body
3528
+ ret = Comet::StorageFreeSpaceInfo.new
3529
+ ret.from_hash(json_body)
3530
+ ret
3531
+ end
3532
+
3533
+ # AdminStorageListBuckets
3534
+ #
3535
+ # List all buckets.
3536
+ #
3537
+ # You must supply administrator authentication credentials to use this API.
3538
+ # This API requires the Storage Role to be enabled.
3539
+ #
3540
+ # @return [Hash{String => Comet::BucketProperties}]
3541
+ def admin_storage_list_buckets
3542
+ body = perform_request('api/v1/admin/storage/list-buckets')
3543
+ json_body = JSON.parse body
3544
+ check_status json_body
3545
+ ret = {}
3546
+ if json_body.nil?
3547
+ ret = {}
3548
+ else
3549
+ json_body.each do |k, v|
3550
+ ret[k] = Comet::BucketProperties.new
3551
+ ret[k].from_hash(v)
3552
+ end
3553
+ end
3554
+ ret
3555
+ end
3556
+
3557
+ # AdminStoragePingDestination
3558
+ #
3559
+ # Ping a storage destination.
3560
+ #
3561
+ # You must supply administrator authentication credentials to use this API.
3562
+ # Access to this API may be prevented on a per-administrator basis.
3563
+ # This API requires the Storage Role to be enabled.
3564
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
3565
+ #
3566
+ # @param [Comet::DestinationLocation] extra_data The destination location settings
3567
+ # @return [Comet::CometAPIResponseMessage]
3568
+ def admin_storage_ping_destination(extra_data)
3569
+ submit_params = {}
3570
+ raise TypeError, "'extra_data' expected Comet::DestinationLocation, got #{extra_data.class}" unless extra_data.is_a? Comet::DestinationLocation
3571
+
3572
+ submit_params['ExtraData'] = extra_data.to_json
3573
+
3574
+ body = perform_request('api/v1/admin/storage/ping-destination', submit_params)
3575
+ json_body = JSON.parse body
3576
+ check_status json_body
3577
+ ret = Comet::CometAPIResponseMessage.new
3578
+ ret.from_hash(json_body)
3579
+ ret
3580
+ end
3581
+
3582
+ # AdminStorageRegisterBucket
3583
+ #
3584
+ # Create a new bucket.
3585
+ # Leave the Set* parameters blank to generate a bucket with random credentials, or, supply a pre-hashed password for zero-knowledge operations.
3586
+ # Any auto-generated credentials are returned in the response message.
3587
+ #
3588
+ # You must supply administrator authentication credentials to use this API.
3589
+ # This API requires the Storage Role to be enabled.
3590
+ #
3591
+ # @param [String] set_bucket_value (Optional) Bucket ID
3592
+ # @param [String] set_key_hash_format (Optional) Bucket key hashing format
3593
+ # @param [String] set_key_hash_value (Optional) Bucket key hash
3594
+ # @param [String] set_organization_id (Optional) Target organization ID (>= 20.9.0)
3595
+ # @return [Comet::AddBucketResponseMessage]
3596
+ def admin_storage_register_bucket(set_bucket_value = nil, set_key_hash_format = nil, set_key_hash_value = nil, set_organization_id = nil)
3597
+ submit_params = {}
3598
+ unless set_bucket_value.nil?
3599
+ raise TypeError, "'set_bucket_value' expected String, got #{set_bucket_value.class}" unless set_bucket_value.is_a? String
3600
+
3601
+ submit_params['SetBucketValue'] = set_bucket_value
3602
+ end
3603
+ unless set_key_hash_format.nil?
3604
+ raise TypeError, "'set_key_hash_format' expected String, got #{set_key_hash_format.class}" unless set_key_hash_format.is_a? String
3605
+
3606
+ submit_params['SetKeyHashFormat'] = set_key_hash_format
3607
+ end
3608
+ unless set_key_hash_value.nil?
3609
+ raise TypeError, "'set_key_hash_value' expected String, got #{set_key_hash_value.class}" unless set_key_hash_value.is_a? String
3610
+
3611
+ submit_params['SetKeyHashValue'] = set_key_hash_value
3612
+ end
3613
+ unless set_organization_id.nil?
3614
+ raise TypeError, "'set_organization_id' expected String, got #{set_organization_id.class}" unless set_organization_id.is_a? String
3615
+
3616
+ submit_params['SetOrganizationID'] = set_organization_id
3617
+ end
3618
+
3619
+ body = perform_request('api/v1/admin/storage/register-bucket', submit_params)
3620
+ json_body = JSON.parse body
3621
+ check_status json_body
3622
+ ret = Comet::AddBucketResponseMessage.new
3623
+ ret.from_hash(json_body)
3624
+ ret
3625
+ end
3626
+
3627
+ # AdminUpdateCampaignStart
3628
+ #
3629
+ # Start a new software update campaign.
3630
+ #
3631
+ # You must supply administrator authentication credentials to use this API.
3632
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
3633
+ # This API requires the Software Build Role to be enabled.
3634
+ # This API requires the Auth Role to be enabled.
3635
+ #
3636
+ # @param [Comet::UpdateCampaignOptions] options Configure targets for the software update campaign
3637
+ # @return [Comet::CometAPIResponseMessage]
3638
+ def admin_update_campaign_start(options)
3639
+ submit_params = {}
3640
+ raise TypeError, "'options' expected Comet::UpdateCampaignOptions, got #{options.class}" unless options.is_a? Comet::UpdateCampaignOptions
3641
+
3642
+ submit_params['Options'] = options.to_json
3643
+
3644
+ body = perform_request('api/v1/admin/update-campaign/start', submit_params)
3645
+ json_body = JSON.parse body
3646
+ check_status json_body
3647
+ ret = Comet::CometAPIResponseMessage.new
3648
+ ret.from_hash(json_body)
3649
+ ret
3650
+ end
3651
+
3652
+ # AdminUpdateCampaignStatus
3653
+ #
3654
+ # Get current campaign status.
3655
+ #
3656
+ # You must supply administrator authentication credentials to use this API.
3657
+ # This API is only available for administrator accounts in the top-level Organization, not in any other Organization.
3658
+ # This API requires the Software Build Role to be enabled.
3659
+ # This API requires the Auth Role to be enabled.
3660
+ #
3661
+ # @return [Comet::UpdateCampaignStatus]
3662
+ def admin_update_campaign_status
3663
+ body = perform_request('api/v1/admin/update-campaign/status')
3664
+ json_body = JSON.parse body
3665
+ check_status json_body
3666
+ ret = Comet::UpdateCampaignStatus.new
3667
+ ret.from_hash(json_body)
3668
+ ret
3669
+ end
3670
+
3671
+ # HybridSessionStart
3672
+ #
3673
+ # Generate a session key (log in).
3674
+ # This hybrid API allows you to log in to the Comet Server as either an administrator or end-user account.
3675
+ # This API behaves like either AdminAccountSessionStart or UserWebSessionStart, depending on what the supplied credentials were valid for.
3676
+ #
3677
+ # @return [Comet::SessionKeyRegeneratedResponse]
3678
+ def hybrid_session_start
3679
+ body = perform_request('api/v1/hybrid/session/start')
3680
+ json_body = JSON.parse body
3681
+ check_status json_body
3682
+ ret = Comet::SessionKeyRegeneratedResponse.new
3683
+ ret.from_hash(json_body)
3684
+ ret
3685
+ end
3686
+
3687
+ # UserWebSessionRevoke
3688
+ #
3689
+ # Revoke a session key (log out).
3690
+ #
3691
+ # You must supply user authentication credentials to use this API, and the user account must be authorized for web access.
3692
+ # This API requires the Auth Role to be enabled.
3693
+ #
3694
+ # @return [Comet::CometAPIResponseMessage]
3695
+ def user_web_session_revoke
3696
+ body = perform_request('api/v1/user/web/session/revoke')
3697
+ json_body = JSON.parse body
3698
+ check_status json_body
3699
+ ret = Comet::CometAPIResponseMessage.new
3700
+ ret.from_hash(json_body)
3701
+ ret
3702
+ end
3703
+
3704
+ # UserWebSessionStart
3705
+ #
3706
+ # Generate a session key (log in).
3707
+ #
3708
+ # You must supply user authentication credentials to use this API, and the user account must be authorized for web access.
3709
+ # This API requires the Auth Role to be enabled.
3710
+ #
3711
+ # @return [Comet::SessionKeyRegeneratedResponse]
3712
+ def user_web_session_start
3713
+ body = perform_request('api/v1/user/web/session/start')
3714
+ json_body = JSON.parse body
3715
+ check_status json_body
3716
+ ret = Comet::SessionKeyRegeneratedResponse.new
3717
+ ret.from_hash(json_body)
3718
+ ret
3719
+ end
3720
+
3721
+ # If the supplied object represents an unsuccessful CometAPIResponseMessage, raise
3722
+ # it as an error.
3723
+ #
3724
+ # @param [Hash] obj
3725
+ def check_status(obj)
3726
+ return unless obj.is_a? Hash
3727
+ return unless obj.key?('Status')
3728
+ return unless obj.key?('Message')
3729
+ return unless obj['Status'] != 200 && obj['Status'] != 201
3730
+
3731
+ ret_error = Comet::CometAPIResponseMessage.new
3732
+ ret_error.from_hash(obj)
3733
+ raise Comet::APIResponseError, ret_error
3734
+ end
3735
+
3736
+ # Perform a synchronous HTTP request.
3737
+ #
3738
+ # @param [String] endpoint The URL suffix
3739
+ # @param [Hash<String,String>] params Form post parameters to submit to the target API
3740
+ # @return [String] Response body
3741
+ def perform_request(endpoint, params = {})
3742
+ full_uri = URI(@server_address + endpoint)
3743
+ params['Username'] = @username
3744
+ params['AuthType'] = 'Password'
3745
+ params['Password'] = @password
3746
+
3747
+ res = Net::HTTP.post_form(full_uri, params)
3748
+ unless res.is_a?(Net::HTTPSuccess)
3749
+ raise res
3750
+ end
3751
+
3752
+ res.body
3753
+ end
3754
+
3755
+ # Perform a synchronous HTTP request, using multipart/form-data.
3756
+ #
3757
+ # @param [String] endpoint The URL suffix
3758
+ # @param [Hash<String,String>] params Form post parameters to submit to the target API
3759
+ # @return [String] Response body
3760
+ def perform_request_multipart(endpoint, params = {})
3761
+ full_uri = URI(@server_address + endpoint)
3762
+
3763
+ req = Net::HTTP::Post.new(full_uri)
3764
+ req['X-Comet-Admin-Username'] = @username
3765
+ req['X-Comet-Admin-AuthType'] = 'Password'
3766
+ req['X-Comet-Admin-Password'] = @password
3767
+
3768
+ form_params = []
3769
+ params.each do |k, v|
3770
+ form_params.append [k, v, { :filename => k }]
3771
+ end
3772
+ req.set_form(form_params, 'multipart/form-data')
3773
+
3774
+ http = Net::HTTP.new(full_uri.hostname, full_uri.port)
3775
+ res = http.request(req)
3776
+
3777
+ unless res.is_a?(Net::HTTPSuccess)
3778
+ raise res
3779
+ end
3780
+
3781
+ res.body
3782
+ end
3783
+ end
3784
+
3785
+ end