Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 422 When creating server from BungeeCord #21

Open
Acixsi opened this issue Apr 27, 2020 · 3 comments
Open

Error 422 When creating server from BungeeCord #21

Acixsi opened this issue Apr 27, 2020 · 3 comments

Comments

@Acixsi
Copy link

Acixsi commented Apr 27, 2020

Hi there,

I'm trying to make a system where I can deploy new servers from inside our Bungeecord proxy using this API. But now comes the point where I'm getting errors... I'm getting this:

>.... [02:27:49 INFO]: An error occurred while making a request to the panel, if the issue persists please create an issue on github.
>.... [02:27:49 INFO]: 422 POST https://panel.snl.bruijns.tech/api/application/servers

And this is my code:

public class ServerHandler extends Command {

    public ServerHandler(ServerDeployer serverDeployer) {
        super("deploypf");
    }

    public static void deployNew() {
        PteroAdminAPI api = new PteroAdminAPI("https://panel.snl.bruijns.tech/", "I HAVE MY KEY HERE USUALLY, BUT REMOVED IT FOR NOW.");
        ServerCreateAction server = api.getServersController().createNew();
        server.setName("pf01").setDescription("TEST FOR PF01").setUserId(2).setAllocation(1).setPortRange(String.valueOf(25657)).setLimits(1024, -1, 0, 500, 0).setEggId(17).setPackId(1).setDockerImage("quay.io/pterodactyl/core:java").setStartOnCompletion(true).execute();
    }

    @Override
    public void execute(CommandSender sender, String[] args) {
        if(sender instanceof ProxiedPlayer) {
            ProxiedPlayer p = (ProxiedPlayer) sender;
            deployNew();
        }
    }
}

Is there any possibility you can help me solving my issue?

I hope to hear from you!

@Skogrine
Copy link

i have the same problem

@MoMMde
Copy link

MoMMde commented May 14, 2021

same problem...

@Skogrine
Copy link

I offer you this dependency, which to my taste, is much more complete and easy to use

Pterodactyl4J

Have a good day :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants