gridscale / gsclient-js

The official gridscale API client written in TypeScript / JavaScript
https://gridscale.io
MIT License
3 stars 0 forks source link

Unable to request ips #6

Closed wehrstedt closed 4 years ago

wehrstedt commented 4 years ago

Im not able to request ip adresses anymore. Im using the following function to request an ip adress:

public async requestIp(ipFamily: "IPv4" | "IPv6", locationUUID: string): Promise<IIP> {
        try {
            this.logger(`Request ip for location ${locationUUID}`);
            const mappedIpFamily = (ipFamily === "IPv4") ? 4 : 6;
            const response = await this.client.IP.create({
                family: mappedIpFamily,
                location_uuid: locationUUID,
            });

            if (response.success && (response.response.statusCode === 202 || response.response.statusCode === 200)) {
                return response.result;
            } else {
                throw new Error(`Failed to request ip of family '${ipFamily}' for location '${locationUUID}': ${JSON.stringify(response)}`);
            }
        } catch (err) {
            throw this.logError(err, `Can't request ip`);
        }
    }

But the request fails: image

Version: @gridscale/api@^0.2.9 Node: v13.1.0

JanST123 commented 4 years ago

Hi,

Could be that you hit your account limit of maximum amount of v4 adresses (you can view the limits here: https://my.gridscale.io/Easy/Panel/Usage/)

wehrstedt commented 4 years ago

Sorry, the issue was the limit of available ip adresses. It's now increased. Thank you!