Пример #1
0
        // List the application versions for each environment
        public static void Main(string[] args)
        {
            // Use the AuthenticationService API to get a session token.
            // See its implementation on the Authorization Service API
            String token = AuthenticationExample.getToken();

            // Create an authentication object to send in the WS call and set it with the session token
            WebServiceSimpleAuthentication authentication = new WebServiceSimpleAuthentication();

            authentication.Token = token;

            // Application Management Service WS proxy created by Visual Studio
            ApplicationManagementService service = new ApplicationManagementService();

            // The status of the WS call
            bool      success = false;
            APIStatus status  = null;

            ApplicationInfo[] applicationList = null;

            // Invoke the Application_List web method
            // WS returns a boolean and status code to signal success
            success = service.Application_List(authentication, out status, out applicationList);

            // If the call was successful, print the applications and their versions
            if (success)
            {
                foreach (ApplicationInfo application in applicationList)
                {
                    Console.Write(String.Format("\n{0,-30}", application.Name));
                    foreach (EnvironmentApplicationInfo applicationInEnvironment in application.StatusInEnvironments)
                    {
                        // Print app version or '-' if it is not deployed on the environment
                        Console.Write(String.Format("{0,-20}",
                                                    applicationInEnvironment.ExistsInEnvironment ? applicationInEnvironment.Version : "-"));
                    }
                }
            }
            else
            {
                // Implement error handling by checking the status.ResponseId field
                // See the possible error codes in the APIStatus structure documentation
            }
        }
Пример #2
0
        //List the environments registered in LifeTime
        static void Main(string[] args)
        {
            // Use the AuthenticationService API to get a session token.
            // See its implementation on the Authorization Service API
            String token = AuthenticationExample.getToken();

            // Create an authentication object to send in the WS call and set it with the session token
            WebServiceSimpleAuthentication authentication = new WebServiceSimpleAuthentication();

            authentication.Token = token;

            //Environment Management Service WS proxy created by Visual Studio
            EnvironmentManagementService service = new EnvironmentManagementService();

            // The status of the WS call
            bool      success = false;
            APIStatus status  = null;

            EnvironmentInfo[] environments = null;

            //Invoke the Environment_List web method
            success = service.Environment_List(authentication, out status, out environments);

            //If the call was successful, print information about the environments
            if (success)
            {
                foreach (EnvironmentInfo environment in environments)
                {
                    Console.WriteLine(String.Format("{0}: {1} front-end(s) running on {2} with {3}",
                                                    environment.Name, environment.NumberOfFrontEnds,
                                                    environment.ApplicationServerType,
                                                    environment.DatabaseProvider));
                }
            }
            else
            {
                // Implement error handling by checking the status.ResponseId field
                // See the possible error codes in the APIStatus structure documentation
            }
        }
        // List the application permission levels available
        public static void Main(string[] args)
        {
            // Use the AuthenticationService API to get a session token.
            // See its implementation on the Authorization Service API
            String token = AuthenticationExample.getToken();

            // Create an authentication object to send in the WS call and set it with the session token
            WebServiceSimpleAuthentication authentication = new WebServiceSimpleAuthentication();

            authentication.Token = token;

            // Application Management Service WS proxy created by Visual Studio
            ApplicationManagementService service = new ApplicationManagementService();

            // The status of the WS call
            bool      success = false;
            APIStatus status  = null;

            ApplicationPermissionLevel[] permissionLevels = null;

            // Invoke the ApplicationPermissionLevel_List web method
            // WS returns a boolean and status code to signal success
            success = service.ApplicationPermissionLevel_List(authentication, out status, out permissionLevels);


            // If the call was successful, print the permission levels available
            if (success)
            {
                foreach (ApplicationPermissionLevel permission in permissionLevels)
                {
                    Console.WriteLine(String.Format("{0}", permission.ShortLabel));
                }
            }
            else
            {
                // Implement error handling by checking the status.ResponseId field
                // See the possible error codes in the APIStatus structure documentation
            }
        }
Пример #4
0
        //List IT users registered in LifeTime
        static void Main(string[] args)
        {
            // Use the AuthenticationService API to get a session token.
            // See its implementation on the Authorization Service API
            String token = AuthenticationExample.getToken();

            // Create an authentication object to send in the WS call and set it with the session token
            WebServiceSimpleAuthentication authentication = new WebServiceSimpleAuthentication();

            authentication.Token = token;

            // Role Management Service WS proxy created by Visual Studio
            UserManagementService service = new UserManagementService();

            // The status of the WS call
            bool      success = false;
            APIStatus status  = null;

            PlatformUser[] users = null;

            //Invoke the User_List web method, to only display active users
            success = service.User_List(authentication, false, out status, out users);


            //If the call was successful, print information about the users
            if (success)
            {
                foreach (PlatformUser user in users)
                {
                    Console.WriteLine(String.Format("{0} ({1}) has the {2} role", user.Name, user.Username, user.RoleName));
                }
            }
            else
            {
                // Implement error handling by checking the status.ResponseId field
                // See the possible error codes in the APIStatus structure documentation
            }
        }
        //List IT roles registered in LifeTime
        public static void Main(string[] args)
        {
            // Use the AuthenticationService API to get a session token.
            // See its implementation on the Authorization Service API
            String token = AuthenticationExample.getToken();

            // Create an authentication object to send in the WS call and set it with the session token
            WebServiceSimpleAuthentication authentication = new WebServiceSimpleAuthentication();

            authentication.Token = token;

            // Role Management Service WS proxy created by Visual Studio
            RoleManagementService service = new RoleManagementService();

            // The status of the WS call
            bool      success = false;
            APIStatus status  = null;

            PlatformRole[] roles = null;

            //Invoke the Role_List web method
            success = service.Role_List(authentication, out status, out roles);

            //If the call was successful, print information about the role
            if (success)
            {
                foreach (PlatformRole role in roles)
                {
                    Console.WriteLine(String.Format("{0,-20}{1}", role.Name, role.Description));
                }
            }
            else
            {
                // Implement error handling by checking the status.ResponseId field
                // See the possible error codes in the APIStatus structure documentation
            }
        }
Пример #6
0
        //List applications managed by a specific team
        public static void Main(string[] args)
        {
            // Use the AuthenticationService API to get a session token.
            // See its implementation on the Authorization Service API
            String token = AuthenticationExample.getToken();

            // Create an authentication object to send in the WS call and set it with the session token
            WebServiceSimpleAuthentication authentication = new WebServiceSimpleAuthentication();

            authentication.Token = token;

            // Role Management Service WS proxy created by Visual Studio
            TeamManagementService service = new TeamManagementService();

            // The status of the WS call
            bool         success = false;
            APIStatus    status  = null;
            PlatformTeam team    = null;

            //Invoke the Team_Details web method
            success = service.Team_GetDetails(authentication, "Customer Portal team", out status, out team);

            //If the call was successful, print information about the role
            if (success)
            {
                Console.WriteLine(String.Format("{0}:", team.Name));
                foreach (ApplicationShortInfo application in team.ApplicationList)
                {
                    Console.WriteLine(String.Format("\t{0}", application.Name));
                }
            }
            else
            {
                // Implement error handling by checking the status.ResponseId field
                // See the possible error codes in the APIStatus structure documentation
            }
        }
Пример #7
0
        //List IT roles registered in LifeTime
        public static void Main(string[] args)
        {
            // Use the AuthenticationService API to get a session token.
            // See its implementation on the Authorization Service API
            String token = AuthenticationExample.getToken();

            // Create an authentication object to send in the WS call and set it with the session token
            WebServiceSimpleAuthentication authentication = new WebServiceSimpleAuthentication();

            authentication.Token = token;

            // Role Management Service WS proxy created by Visual Studio
            RoleManagementService service = new RoleManagementService();

            // The status of the WS call
            bool      success = false;
            APIStatus status  = null;

            EnvironmentPermissionForRole[] permissions = null;

            //Invoke the Role_GetPermissions web method for the Developer role
            success = service.Role_GetPermissions(authentication, "Developer", out status, out permissions);

            //If the call was successful, print information about the role
            if (success)
            {
                foreach (EnvironmentPermissionForRole permission in permissions)
                {
                    Console.WriteLine(String.Format("{0,-20}{1}", permission.EnvironmentName, permission.EnvironmentPermissionLevelId));
                }
            }
            else
            {
                // Implement error handling by checking the status.ResponseId field
                // See the possible error codes in the APIStatus structure documentation
            }
        }