src/siteServices/siteServices.class.ts
constructor(conf: ShifterConfig)
|
Public retrieve |
retrieve(siteId: string)
|
Get site service status
Returns:
any
|
Public start |
start(siteId: string)
|
Start WordPress container
Returns:
any
|
Public stop |
stop(siteId: string)
|
Stop WordPress container
Returns:
any
|
import { ShifterClient, ShifterConfig } from '../client';
import { SiteServiceStatus } from './siteServices.interface';
export class SiteServices extends ShifterClient {
constructor(conf: ShifterConfig) {
super({
...conf,
resource: 'sites',
});
}
/**
* Get site service status
*/
public async retrieve(siteId: string): Promise<SiteServiceStatus> {
return this.get<SiteServiceStatus>(`${siteId}/services`);
}
/**
* Start WordPress container
*/
public async start(siteId: string): Promise<void> {
return this.post<void>(`${siteId}/services`);
}
/**
* Stop WordPress container
*/
public async stop(siteId: string): Promise<void> {
return this.delete<void>(`${siteId}/services`);
}
}