-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from Sleitnick/feature/universe
Universe API
- Loading branch information
Showing
12 changed files
with
590 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Universe API | ||
|
||
## Getting Universe Info | ||
``` | ||
Usage: rbxcloud universe get [OPTIONS] --universe-id <UNIVERSE_ID> --api-key <API_KEY> | ||
Options: | ||
-u, --universe-id <UNIVERSE_ID> Universe ID | ||
-p, --pretty Pretty-print the JSON response | ||
-a, --api-key <API_KEY> Roblox Open Cloud API Key [env: RBXCLOUD_API_KEY=] | ||
-h, --help Print help | ||
``` | ||
|
||
### Example | ||
``` | ||
$ rbxcloud universe get -p -u 12345 -a MY_KEY | ||
``` | ||
|
||
## Updating Name | ||
``` | ||
Usage: rbxcloud universe update-name [OPTIONS] --universe-id <UNIVERSE_ID> --name <NAME> --api-key <API_KEY> | ||
Options: | ||
-u, --universe-id <UNIVERSE_ID> Universe ID | ||
-n, --name <NAME> New Universe name | ||
-p, --pretty Pretty-print the JSON response | ||
-a, --api-key <API_KEY> Roblox Open Cloud API Key [env: RBXCLOUD_API_KEY=] | ||
-h, --help Print help | ||
``` | ||
|
||
### Example | ||
``` | ||
$ rbxcloud universe update-name -n "Experience Name" -p -u 12345 -a MY_KEY | ||
``` | ||
|
||
## Updating Description | ||
``` | ||
Usage: rbxcloud universe update-description [OPTIONS] --universe-id <UNIVERSE_ID> --description <DESCRIPTION> --api-key <API_KEY> | ||
Options: | ||
-u, --universe-id <UNIVERSE_ID> Universe ID | ||
-d, --description <DESCRIPTION> New Universe description | ||
-p, --pretty Pretty-print the JSON response | ||
-a, --api-key <API_KEY> Roblox Open Cloud API Key [env: RBXCLOUD_API_KEY=] | ||
-h, --help Print help | ||
``` | ||
|
||
### Example | ||
``` | ||
$ rbxcloud universe update-description -n "Experience description here." -p -u 12345 -a MY_KEY | ||
``` | ||
|
||
## Restarting Servers | ||
``` | ||
Usage: rbxcloud universe restart --universe-id <UNIVERSE_ID> --api-key <API_KEY> | ||
Options: | ||
-u, --universe-id <UNIVERSE_ID> Universe ID | ||
-a, --api-key <API_KEY> Roblox Open Cloud API Key [env: RBXCLOUD_API_KEY=] | ||
-h, --help Print help | ||
``` | ||
|
||
### Example | ||
``` | ||
$ rbxcloud universe restart -u 12345 -a MY_KEY | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use rbxcloud::rbx::{error::Error, types::UniverseId, v2::Client}; | ||
|
||
async fn restart_servers() -> Result<(), Error> { | ||
// Inputs: | ||
let api_key = "MY_API_KEY"; | ||
let universe_id = 9876543210; | ||
|
||
let client = Client::new(api_key); | ||
let universe_client = client.universe(UniverseId(universe_id)); | ||
|
||
universe_client.restart_servers().await | ||
} | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let restart_result = restart_servers().await; | ||
|
||
match restart_result { | ||
Ok(()) => { | ||
println!("Servers restarted"); | ||
} | ||
Err(e) => { | ||
eprintln!("{e:?}"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.