Organization autoscaling (#487)

* Seat autoscaling api changes

* Update all organization subscription
aspects with one api call

* Remove disable autoscale option

* Remove autoscale request references

* Remove autoscale update
This commit is contained in:
Matt Gibson 2021-09-17 11:20:48 -04:00 committed by GitHub
parent 83548a6753
commit 5cec31f871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 0 deletions

View File

@ -33,6 +33,7 @@ import { KeysRequest } from '../models/request/keysRequest';
import { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';
import { OrganizationImportRequest } from '../models/request/organizationImportRequest';
import { OrganizationKeysRequest } from '../models/request/organizationKeysRequest';
import { OrganizationSubscriptionUpdateRequest } from '../models/request/organizationSubscriptionUpdateRequest';
import { OrganizationTaxInfoUpdateRequest } from '../models/request/organizationTaxInfoUpdateRequest';
import { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest';
import { OrganizationUpgradeRequest } from '../models/request/organizationUpgradeRequest';
@ -381,6 +382,7 @@ export abstract class ApiService {
postOrganizationApiKey: (id: string, request: PasswordVerificationRequest) => Promise<ApiKeyResponse>;
postOrganizationRotateApiKey: (id: string, request: PasswordVerificationRequest) => Promise<ApiKeyResponse>;
postOrganizationUpgrade: (id: string, request: OrganizationUpgradeRequest) => Promise<PaymentResponse>;
postOrganizationUpdateSubscription: (id: string, request: OrganizationSubscriptionUpdateRequest) => Promise<void>;
postOrganizationSeat: (id: string, request: SeatRequest) => Promise<PaymentResponse>;
postOrganizationStorage: (id: string, request: StorageRequest) => Promise<any>;
postOrganizationPayment: (id: string, request: PaymentRequest) => Promise<any>;

View File

@ -13,6 +13,7 @@ export class OrganizationCreateRequest {
paymentMethodType: PaymentMethodType;
paymentToken: string;
additionalSeats: number;
maxAutoscaleSeats: number;
additionalStorageGb: number;
premiumAccessAddon: boolean;
collectionName: string;

View File

@ -0,0 +1,3 @@
export class OrganizationSubscriptionUpdateRequest {
constructor(public seatAdjustment: number, public maxAutoscaleSeats?: number) { }
}

View File

@ -17,6 +17,7 @@ export class OrganizationResponse extends BaseResponse {
plan: PlanResponse;
planType: PlanType;
seats: number;
maxAutoscaleSeats: number;
maxCollections: number;
maxStorageGb: number;
useGroups: boolean;
@ -44,6 +45,7 @@ export class OrganizationResponse extends BaseResponse {
this.plan = plan == null ? null : new PlanResponse(plan);
this.planType = this.getResponseProperty('PlanType');
this.seats = this.getResponseProperty('Seats');
this.maxAutoscaleSeats = this.getResponseProperty('MaxAutoscaleSeats');
this.maxCollections = this.getResponseProperty('MaxCollections');
this.maxStorageGb = this.getResponseProperty('MaxStorageGb');
this.useGroups = this.getResponseProperty('UseGroups');

View File

@ -36,6 +36,7 @@ import { KeysRequest } from '../models/request/keysRequest';
import { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';
import { OrganizationImportRequest } from '../models/request/organizationImportRequest';
import { OrganizationKeysRequest } from '../models/request/organizationKeysRequest';
import { OrganizationSubscriptionUpdateRequest } from '../models/request/organizationSubscriptionUpdateRequest';
import { OrganizationTaxInfoUpdateRequest } from '../models/request/organizationTaxInfoUpdateRequest';
import { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest';
import { OrganizationUpgradeRequest } from '../models/request/organizationUpgradeRequest';
@ -1192,6 +1193,10 @@ export class ApiService implements ApiServiceAbstraction {
return new PaymentResponse(r);
}
async postOrganizationUpdateSubscription(id: string, request: OrganizationSubscriptionUpdateRequest): Promise<void> {
return this.send('POST', '/organizations/' + id + '/subscription', request, true, false);
}
async postOrganizationSeat(id: string, request: SeatRequest): Promise<PaymentResponse> {
const r = await this.send('POST', '/organizations/' + id + '/seat', request, true, true);
return new PaymentResponse(r);