feat(apiclient): Added support for managing external registries in the API client.
This commit is contained in:
parent
355e04fd1d
commit
a617f51b19
@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2024-12-29 - 4.10.0 - feat(apiclient)
|
||||||
|
Added support for managing external registries in the API client.
|
||||||
|
|
||||||
|
- Introduced methods to get a registry by ID, get all registries, and create a new registry in the externalRegistry object.
|
||||||
|
- Updated external registry request interfaces to match new API client capabilities.
|
||||||
|
|
||||||
## 2024-12-29 - 4.9.0 - feat(apiclient)
|
## 2024-12-29 - 4.9.0 - feat(apiclient)
|
||||||
Add external registry management capabilities to Cloudly API client.
|
Add external registry management capabilities to Cloudly API client.
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@serve.zone/cloudly',
|
name: '@serve.zone/cloudly',
|
||||||
version: '4.9.0',
|
version: '4.10.0',
|
||||||
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
|
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import { Service } from './classes.service.js';
|
|||||||
import { Cluster } from './classes.cluster.js';
|
import { Cluster } from './classes.cluster.js';
|
||||||
import { SecretBundle } from './classes.secretbundle.js';
|
import { SecretBundle } from './classes.secretbundle.js';
|
||||||
import { SecretGroup } from './classes.secretgroup.js';
|
import { SecretGroup } from './classes.secretgroup.js';
|
||||||
|
import { ExternalRegistry } from './classes.externalregistry.js';
|
||||||
|
|
||||||
export class CloudlyApiClient {
|
export class CloudlyApiClient {
|
||||||
private cloudlyUrl: string;
|
private cloudlyUrl: string;
|
||||||
@ -159,6 +160,19 @@ export class CloudlyApiClient {
|
|||||||
return typedResponse.certificate;
|
return typedResponse.certificate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public externalRegistry = {
|
||||||
|
// ExternalRegistry
|
||||||
|
getRegistryById: async (registryNameArg: string) => {
|
||||||
|
return ExternalRegistry.getExternalRegistryById(this, registryNameArg);
|
||||||
|
},
|
||||||
|
getRegistries: async () => {
|
||||||
|
return ExternalRegistry.getExternalRegistries(this);
|
||||||
|
},
|
||||||
|
createRegistry: async (optionsArg: Parameters<typeof ExternalRegistry.createExternalRegistry>[1]) => {
|
||||||
|
return ExternalRegistry.createExternalRegistry(this, optionsArg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public image = {
|
public image = {
|
||||||
// Images
|
// Images
|
||||||
getImageById: async (imageIdArg: string) => {
|
getImageById: async (imageIdArg: string) => {
|
||||||
|
@ -3,7 +3,7 @@ import type { CloudlyApiClient } from './classes.cloudlyapiclient.js';
|
|||||||
|
|
||||||
export class ExternalRegistry implements plugins.servezoneInterfaces.data.IExternalRegistry {
|
export class ExternalRegistry implements plugins.servezoneInterfaces.data.IExternalRegistry {
|
||||||
// STATIC
|
// STATIC
|
||||||
public static async getRegistryById(cloudlyClientRef: CloudlyApiClient, registryNameArg: string) {
|
public static async getExternalRegistryById(cloudlyClientRef: CloudlyApiClient, registryNameArg: string) {
|
||||||
const getRegistryByIdTR = cloudlyClientRef.typedsocketClient.createTypedRequest<plugins.servezoneInterfaces.requests.externalRegistry.IReq_GetRegistryById>(
|
const getRegistryByIdTR = cloudlyClientRef.typedsocketClient.createTypedRequest<plugins.servezoneInterfaces.requests.externalRegistry.IReq_GetRegistryById>(
|
||||||
'getExternalRegistryById'
|
'getExternalRegistryById'
|
||||||
);
|
);
|
||||||
@ -16,7 +16,7 @@ export class ExternalRegistry implements plugins.servezoneInterfaces.data.IExter
|
|||||||
return newRegistry;
|
return newRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async getRegistries(cloudlyClientRef: CloudlyApiClient) {
|
public static async getExternalRegistries(cloudlyClientRef: CloudlyApiClient) {
|
||||||
const getRegistriesTR = cloudlyClientRef.typedsocketClient.createTypedRequest<plugins.servezoneInterfaces.requests.externalRegistry.IReq_GetRegistries>(
|
const getRegistriesTR = cloudlyClientRef.typedsocketClient.createTypedRequest<plugins.servezoneInterfaces.requests.externalRegistry.IReq_GetRegistries>(
|
||||||
'getExternalRegistries'
|
'getExternalRegistries'
|
||||||
);
|
);
|
||||||
@ -32,13 +32,12 @@ export class ExternalRegistry implements plugins.servezoneInterfaces.data.IExter
|
|||||||
return registryConfigs;
|
return registryConfigs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async createRegistry(cloudlyClientRef: CloudlyApiClient, registryNameArg: string, registryDataArg: Partial<plugins.servezoneInterfaces.data.IExternalRegistry['data']>) {
|
public static async createExternalRegistry(cloudlyClientRef: CloudlyApiClient, registryDataArg: Partial<plugins.servezoneInterfaces.data.IExternalRegistry['data']>) {
|
||||||
const createRegistryTR = cloudlyClientRef.typedsocketClient.createTypedRequest<plugins.servezoneInterfaces.requests.externalRegistry.IReq_CreateRegistry>(
|
const createRegistryTR = cloudlyClientRef.typedsocketClient.createTypedRequest<plugins.servezoneInterfaces.requests.externalRegistry.IReq_CreateRegistry>(
|
||||||
'createExternalRegistry'
|
'createExternalRegistry'
|
||||||
);
|
);
|
||||||
const response = await createRegistryTR.fire({
|
const response = await createRegistryTR.fire({
|
||||||
identity: cloudlyClientRef.identity,
|
identity: cloudlyClientRef.identity,
|
||||||
registryName: registryNameArg,
|
|
||||||
registryData: registryDataArg as plugins.servezoneInterfaces.data.IExternalRegistry['data'],
|
registryData: registryDataArg as plugins.servezoneInterfaces.data.IExternalRegistry['data'],
|
||||||
});
|
});
|
||||||
const newRegistry = new ExternalRegistry(cloudlyClientRef);
|
const newRegistry = new ExternalRegistry(cloudlyClientRef);
|
||||||
|
@ -36,7 +36,6 @@ export interface IReq_CreateRegistry extends plugins.typedrequestInterfaces.impl
|
|||||||
method: 'createExternalRegistry';
|
method: 'createExternalRegistry';
|
||||||
request: {
|
request: {
|
||||||
identity: userInterfaces.IIdentity;
|
identity: userInterfaces.IIdentity;
|
||||||
registryName: string;
|
|
||||||
registryData: data.IExternalRegistry['data'];
|
registryData: data.IExternalRegistry['data'];
|
||||||
};
|
};
|
||||||
response: {
|
response: {
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@serve.zone/cloudly',
|
name: '@serve.zone/cloudly',
|
||||||
version: '4.9.0',
|
version: '4.10.0',
|
||||||
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
|
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user