{"id":21601543,"url":"https://github.com/vmware-samples/site-recovery-manager-rest-api-examples","last_synced_at":"2025-03-18T13:19:28.506Z","repository":{"id":187413421,"uuid":"669116658","full_name":"vmware-samples/site-recovery-manager-rest-api-examples","owner":"vmware-samples","description":"Site Recovery Manager and vSphere Replication REST API was released in 8.6 and 8.7 of the product. We would like to create a codespace in VMware github to provide examples of the main use cases which our customers have difficulties with. These examples will be code snippets (or the whole request) of working REST API requests.","archived":false,"fork":false,"pushed_at":"2025-03-04T12:19:05.000Z","size":140,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T13:26:49.450Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vmware-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING_DCO.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-21T11:34:19.000Z","updated_at":"2025-03-04T12:19:09.000Z","dependencies_parsed_at":"2023-08-10T08:48:41.655Z","dependency_job_id":"b30d3a2c-b68b-4649-952a-5d6a868247be","html_url":"https://github.com/vmware-samples/site-recovery-manager-rest-api-examples","commit_stats":null,"previous_names":["vmware-samples/site-recovery-manager-rest-api-examples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-samples%2Fsite-recovery-manager-rest-api-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-samples%2Fsite-recovery-manager-rest-api-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-samples%2Fsite-recovery-manager-rest-api-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-samples%2Fsite-recovery-manager-rest-api-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vmware-samples","download_url":"https://codeload.github.com/vmware-samples/site-recovery-manager-rest-api-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244227577,"owners_count":20419263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T19:09:51.146Z","updated_at":"2025-03-18T13:19:28.483Z","avatar_url":"https://github.com/vmware-samples.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# site-recovery-manager-rest-api-examples\n\nExamples (code snippets) of working REST API requests. \n\n## 1. Prerequisites\nREST API gateway Open API spec file in one of the formats - .json or .yaml\n\nREST API client generator.\n\nOnline option - https://editor.swagger.io/\n\nMaven option:\n\n**swagger-codegen-maven-plugin**\n```\n\u003cplugin\u003e\n   \u003cgroupId\u003eio.swagger.codegen.v3\u003c/groupId\u003e\n   \u003cartifactId\u003eswagger-codegen-maven-plugin\u003c/artifactId\u003e\n   \u003cversion\u003e3.0.32\u003c/version\u003e\n   \u003cdependencies\u003e\n      \u003cdependency\u003e\n         \u003cgroupId\u003ecom.github.jknack\u003c/groupId\u003e\n         \u003cartifactId\u003ehandlebars\u003c/artifactId\u003e\n         \u003cversion\u003e4.3.0\u003c/version\u003e\n      \u003c/dependency\u003e\n   \u003c/dependencies\u003e\n   \u003cexecutions\u003e\n      \u003cexecution\u003e\n         \u003cphase\u003egenerate-sources\u003c/phase\u003e\n         \u003cgoals\u003e\n            \u003cgoal\u003egenerate\u003c/goal\u003e\n         \u003c/goals\u003e\n         \u003cconfiguration\u003e\n            \u003cinputSpec\u003e${swagger.definitions.url}\u003c/inputSpec\u003e\n            \u003clanguage\u003ejava\u003c/language\u003e\n            \u003coutput\u003e${swagger.output.dir}\u003c/output\u003e\n            \u003cgenerateSupportingFiles\u003etrue\u003c/generateSupportingFiles\u003e\n            \u003cgenerateApiTests\u003efalse\u003c/generateApiTests\u003e\n            \u003cgenerateApiDocumentation\u003efalse\u003c/generateApiDocumentation\u003e\n            \u003cgenerateModelTests\u003efalse\u003c/generateModelTests\u003e\n            \u003cgenerateModelDocumentation\u003efalse\u003c/generateModelDocumentation\u003e\n            \u003cenvironmentVariables\u003e\n               \u003cio.swagger.v3.parser.util.RemoteUrl.trustAll\u003etrue\u003c/io.swagger.v3.parser.util.RemoteUrl.trustAll\u003e\n            \u003c/environmentVariables\u003e\n            \u003cconfigOptions\u003e\n               \u003cdateLibrary\u003elegacy\u003c/dateLibrary\u003e\n               \u003cuseRuntimeException\u003etrue\u003c/useRuntimeException\u003e\n               \u003chideGenerationTimestamp\u003etrue\u003c/hideGenerationTimestamp\u003e\n            \u003c/configOptions\u003e\n         \u003c/configuration\u003e\n      \u003c/execution\u003e\n   \u003c/executions\u003e\n\u003c/plugin\u003e\n```\nOther options are also available.\n\nProject build tools - Maven, Gradle, etc.\n\n## 2. Project Setup Steps\nGenerate REST API gateway client.\n\nBuild REST API gateway generated client.\n\nCreate your project and introduce dependency on REST API gateway client built in the previous step.\n\nWrite your code to start calling REST API gateway endpoints.\n\nFirst start with login request in order to obtain REST API gateway session token. This needs Basic Authentication with user and password credentials for the local SRM/HMS site. Add the obtained session token to the header, with key \"x-dr-session\", of every future REST API request.\n\nCall get all pairings request. This is a preliminary step before calling remote login request.\n\nCall remote login request in order to authenticate to the SRM/HMS remote site. This needs Basic Authentication with user and password credentials for the remote SRM/HMS site.\n\nNow logged in at the local and remote site, any request of your interest can be made.\n\n\nWith project build tool of your choice build your project.\n\n## Contributing\n\nThe site-recovery-manager-rest-api-examples project team welcomes contributions from the community. Before you start working with site-recovery-manager-rest-api-examples, please\nread our [Developer Certificate of Origin](https://cla.vmware.com/dco). All contributions to this repository must be\nsigned as described on that page. Your signature certifies that you wrote the patch or have the right to pass it on\nas an open-source patch. For more detailed information, refer to [CONTRIBUTING_DCO.md](CONTRIBUTING_DCO.md).\n\n## License\n\nBSD-2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware-samples%2Fsite-recovery-manager-rest-api-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvmware-samples%2Fsite-recovery-manager-rest-api-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware-samples%2Fsite-recovery-manager-rest-api-examples/lists"}