Function: Create a vCloud Event Log Entry

by Simon Sparks · 27 May 2021

To use this function add it to the class library file named vCloudService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: vCloudService.ts

Description: Orchestrator Function to Create a vCloud Event Log Entry

Function VclEventCreate

public VclEventCreate(strErrorMessage: string, objVclUser: VclUser, objVclOrganization: VclOrganization): boolean {
    try {
        let objVclEvent: VclEvent = new VclEvent();
        objVclEvent.type = "Task";
        objVclEvent.typeFull = strErrorMessage;
        objVclEvent.serviceNamespace = "orchestrator.cloudbuildtools.com";
        objVclEvent.success = true;
        objVclEvent.owner = objVclUser.getReference();
        objVclEvent.user = objVclUser.getReference();

        let objVclAdminOrganization: VclAdminOrganization = objVclOrganization.toAdminObject();

        objVclAdminOrganization.createEvent(objVclEvent);

        return true;
    }
    catch (objExeption) {
        return false;
    }
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like