Ejemplo n.º 1
0
        public static async Task MainPagination()
        {
            string compartmentId = Environment.GetEnvironmentVariable("OCI_COMPARTMENT_ID");

            logger.Info("Starting Pagination example");

            // Accepts profile name and creates a auth provider based on config file
            var provider = new ConfigFileAuthenticationDetailsProvider(OciConfigProfileName);
            // Create a client for the service to enable using its APIs
            var identityClient = new IdentityClient(provider, new ClientConfiguration());

            try
            {
                await DoManualPagination(identityClient, compartmentId);

                DoPaginateWithResponsePaginator(identityClient, compartmentId);
                DoPaginateWithRecordPaginator(identityClient, compartmentId);
            }
            catch (Exception e)
            {
                logger.Info($"Received exception due to {e.Message}");
            }
            finally
            {
                logger.Info("ending Pagination example");
                identityClient.Dispose();
            }
        }
Ejemplo n.º 2
0
        public static async Task MainInstancePrincipal()
        {
            // expose the tenancyId for the environment variable OCI_COMPARTMENT_ID
            string tenantId = Environment.GetEnvironmentVariable("OCI_COMPARTMENT_ID");

            // Creates an Instance Principal provider that holds authentication details of the OCI Instance
            // This helps in making API requests by the Instance without user involvement
            var instanceProvider = new InstancePrincipalsAuthenticationDetailsProvider();

            // Create a client for the service to enable using its APIs
            var client = new IdentityClient(instanceProvider, new ClientConfiguration());

            try
            {
                await ListOciRegions(client);
                await ListOciRegionSubscriptions(client, tenantId);
            }
            catch (Exception e)
            {
                logger.Info($"Received exception due to {e.Message}");
            }
            finally
            {
                client.Dispose();
            }
        }
Ejemplo n.º 3
0
        public static async Task MainCompartment()
        {
            logger.Info("Starting example");
            // Create Identity Client
            var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
            var client   = new IdentityClient(provider, new ClientConfiguration());

            logger.Info("IdentityClient created");

            try
            {
                var    compartmentId       = Environment.GetEnvironmentVariable("OCI_COMPARTMENT_ID");
                string sourceCompartmentId = await CreateCompartment(client, compartmentId, "source");

                string targetCompartmentId = await CreateCompartment(client, compartmentId, "target");
                await MoveCompartment(client, sourceCompartmentId, targetCompartmentId);
            }
            catch (Exception e)
            {
                logger.Error($"Failed to move compartments: {e}");
            }
            finally
            {
                client.Dispose();
            }
        }
Ejemplo n.º 4
0
        public static async Task MainRetry()
        {
            string compartmentId = Environment.GetEnvironmentVariable("OCI_COMPARTMENT_ID");

            // Configuring the AuthenticationDetailsProvider. It's assuming there is a default OCI config file
            // "~/.oci/config", and a profile in that config with the name OciConfigProfileName . Make changes to the following
            // line if needed and use ConfigFileAuthenticationDetailsProvider(configurationFilePath, profile);
            var provider = new ConfigFileAuthenticationDetailsProvider(OciConfigProfileName);
            // Create a client for the service to enable using its APIs
            var client = new IdentityClient(provider, new ClientConfiguration());

            try
            {
                await ListOciRegions(client);
                await ListOciRegionSubscriptions(client, compartmentId);
            }
            catch (Exception e)
            {
                logger.Info($"Received exception due to {e.Message}");
            }
            finally
            {
                client.Dispose();
            }
        }
Ejemplo n.º 5
0
        /**
         * Remove all resources created by the 'setup' operation.
         *
         * NB: Resources can only be removed 30 minutes after the last Function
         * invocation.
         *
         * @param provider      the OCI credentials provider.
         * @param region        the OCI region in which to create the required
         *                      resources.
         * @param compartmentId the compartment in which to created the required
         *                      resources.
         * @param name          a name prefix to easily identify the resources.
         */
        private static async Task TearDownResources(IBasicAuthenticationDetailsProvider provider, string compartmentId)
        {
            var identityClient     = new IdentityClient(provider);
            var vcnClient          = new VirtualNetworkClient(provider);
            var fnManagementClient = new FunctionsManagementClient(provider);

            try
            {
                logger.Info("Cleaning up....");

                var vcn = await GetUniqueVcnByName(vcnClient, compartmentId);

                var ig = await GetUniqueInternetGatewayByName(vcnClient, compartmentId, vcn.Id);

                var rt = await GetUniqueRouteTableByName(vcnClient, compartmentId, vcn.Id);

                var subnet = await GetUniqueSubnetByName(vcnClient, compartmentId, vcn.Id);

                var application = await GetUniqueApplicationByName(fnManagementClient, compartmentId);

                var fn = await GetUniqueFunctionByName(fnManagementClient, application.Id, FunctionName);

                if (fn != null)
                {
                    await DeleteFunction(fnManagementClient, fn.Id);
                }

                if (application != null)
                {
                    await DeleteApplication(fnManagementClient, application.Id);
                }

                if (ig != null)
                {
                    await ClearRouteRulesFromDefaultRouteTable(vcnClient, vcn.DefaultRouteTableId);
                    await DeleteInternetGateway(vcnClient, ig.Id);
                }

                if (subnet != null)
                {
                    await DeleteSubnet(vcnClient, subnet);
                }

                if (vcn != null)
                {
                    await DeleteVcn(vcnClient, vcn);
                }
            }
            catch (Exception e)
            {
                logger.Error($"Failed to clean the resources: {e}");
            }
            finally
            {
                fnManagementClient.Dispose();
                vcnClient.Dispose();
                identityClient.Dispose();
            }
        }
Ejemplo n.º 6
0
        /**
         * Create all the OCI and Fn resources required to invoke a function.
         *
         * @param provider      the OCI credentials provider.
         * @param compartmentId the compartment in which to create the required
         *                      resources.
         * @param image         a valid OCI Registry image for the function.
         */
        private static async Task SetUpResources(IBasicAuthenticationDetailsProvider provider, string compartmentId, string image)
        {
            logger.Info("Setting up resources");

            var identityClient     = new IdentityClient(provider);
            var vcnClient          = new VirtualNetworkClient(provider);
            var fnManagementClient = new FunctionsManagementClient(provider);

            Vcn             vcn             = null;
            Subnet          subnet          = null;
            InternetGateway internetGateway = null;

            try
            {
                AvailabilityDomain availablityDomain = await GetAvailabilityDomain(identityClient, compartmentId);

                logger.Info($"availability domain is {availablityDomain.Name}");

                vcn = await CreateVcn(vcnClient, compartmentId);

                internetGateway = await CreateInternalGateway(vcnClient, compartmentId, vcn);
                await AddInternetGatewayToDefaultRouteTable(vcnClient, vcn.DefaultRouteTableId, internetGateway.Id);

                subnet = await CreateSubnet(vcnClient, compartmentId, availablityDomain.Name, vcn.Id);

                var subnetIds = new List <string>()
                {
                    subnet.Id
                };
                Application app = await CreateApplication(fnManagementClient, compartmentId, subnetIds);

                long     memoryInMBs      = 128L;
                int      timeoutInSeconds = 30;
                Function fn = await CreateFunction(fnManagementClient, app.Id, image, memoryInMBs, timeoutInSeconds);
            }
            catch (Exception e)
            {
                logger.Error($"failed to setup resources: {e}");
            }
            finally
            {
                fnManagementClient.Dispose();
                vcnClient.Dispose();
                identityClient.Dispose();
            }
        }
Ejemplo n.º 7
0
        public static async Task MainIdentity()
        {
            string compartmentId = Environment.GetEnvironmentVariable("OCI_COMPARTMENT_ID");
            // Accepts profile name and creates a auth provider based on config file
            var provider = new ConfigFileAuthenticationDetailsProvider(OciConfigProfileName);
            // Create a client for the service to enable using its APIs
            var client = new IdentityClient(provider, new ClientConfiguration());

            try
            {
                await ListOciRegions(client);
                await ListOciRegionSubscriptions(client, compartmentId);
                await UserAndGroupOps(client, compartmentId);
            }
            catch (Exception e)
            {
                logger.Info($"Received exception due to {e.Message}");
            }
            finally
            {
                client.Dispose();
            }
        }
        public static async Task MainContainerEngine(string[] args)
        {
            logger.Info("Starting example");

            string compartmentId = Environment.GetEnvironmentVariable("OCI_COMPARTMENT_ID");
            var    provider      = new ConfigFileAuthenticationDetailsProvider(OciConfigProfileName);

            var containerEngineClient = new ContainerEngineClient(provider);
            var vcnClient             = new VirtualNetworkClient(provider);
            var identityClient        = new IdentityClient(provider);

            Vcn           vcn     = null;
            List <Subnet> subnets = null;

            Cluster cluster = null;

            try
            {
                IdentityModels.AvailabilityDomain availablityDomain = await GetAvailabilityDomain(identityClient, compartmentId);

                logger.Info($"availability domain is {availablityDomain.Name}");

                vcn = await CreateVcn(vcnClient, compartmentId);

                subnets = await CreateSubnet(vcnClient, compartmentId, availablityDomain, vcn.Id);

                //Create a Container Engine Cluster
                List <string> subnetIds = new List <string>();
                foreach (Subnet subnet in subnets)
                {
                    subnetIds.Add(subnet.Id);
                }

                var kubernetesVersion = await GetKubernetesVersion(containerEngineClient);

                cluster = await CreateCluster(containerEngineClient, vcn.Id, subnetIds, kubernetesVersion, compartmentId);

                // Update the container engine cluster
                await UpdateCluster(containerEngineClient, cluster.Id, ClusterNewDisplayName);
            }
            catch (Exception e)
            {
                logger.Error($"Failed to create container engine cluster: {e}");
            }
            finally
            {
                logger.Info("Cleaning up...");

                if (cluster != null)
                {
                    await DeleteCluster(containerEngineClient, cluster.Id);
                }

                for (int i = 0; i < 2; i++)
                {
                    if (subnets[i] != null)
                    {
                        await DeleteSubnet(vcnClient, subnets[i]);
                    }
                }

                if (vcn != null)
                {
                    await DeleteVcn(vcnClient, vcn);
                }

                containerEngineClient.Dispose();
                vcnClient.Dispose();
                identityClient.Dispose();
            }
            logger.Info("End example");
        }
        public static async Task MainContainerEngineNodePool()
        {
            logger.Info("Starting example");

            string compartmentId = Environment.GetEnvironmentVariable("OCI_COMPARTMENT_ID");
            var    provider      = new ConfigFileAuthenticationDetailsProvider(OciConfigProfileName);

            var containerEngineClient = new ContainerEngineClient(provider);
            var vcnClient             = new VirtualNetworkClient(provider);
            var identityClient        = new IdentityClient(provider);

            Vcn           vcn           = null;
            List <Subnet> subnets       = null;
            List <string> lbSubnetIds   = new List <string>();
            List <string> poolSubnetIds = new List <string>();
            Cluster       cluster       = null;
            NodePool      nodePool      = null;

            try
            {
                List <IdentityModels.AvailabilityDomain> availablityDomains = await GetAvailabilityDomains(identityClient, compartmentId);

                vcn = await CreateVcn(vcnClient, compartmentId);

                subnets = await CreateSubnets(vcnClient, compartmentId, vcn);

                lbSubnetIds.Add(subnets[0].Id);
                poolSubnetIds.Add(subnets[1].Id);

                var kubernetesVersion = await GetKubernetesVersion(containerEngineClient);

                cluster = await CreateCluster(containerEngineClient, vcn.Id, lbSubnetIds, kubernetesVersion, compartmentId);

                // Add node pool in the cluster
                KeyValue keyValue = new KeyValue
                {
                    Key   = "key1",
                    Value = "value1"
                };
                List <KeyValue> initialNodeLabels = new List <KeyValue> {
                    keyValue
                };

                List <NodePoolPlacementConfigDetails> nodePoolPlacementConfigDetails = new List <NodePoolPlacementConfigDetails>();
                foreach (var availabilityDomain in availablityDomains)
                {
                    nodePoolPlacementConfigDetails.Add(new NodePoolPlacementConfigDetails
                    {
                        AvailabilityDomain = availabilityDomain.Name,
                        SubnetId           = poolSubnetIds[0]
                    });
                }
                ;

                var createNodePoolNodeConfigDetails = new CreateNodePoolNodeConfigDetails
                {
                    Size             = availablityDomains.Count,
                    PlacementConfigs = nodePoolPlacementConfigDetails
                };
                nodePool = await CreateNodePool(containerEngineClient, compartmentId, cluster.Id, NodePoolDisplayName,
                                                kubernetesVersion, NodeImageName, NodeShape, initialNodeLabels, createNodePoolNodeConfigDetails);

                logger.Info("Created node pool");

                // Update the node pool
                await UpdateNodePool(containerEngineClient, nodePool.Id, NewNodePoolDisplayName);
            }
            catch (Exception e)
            {
                logger.Error($"Failed to create container engine cluster: {e}");
            }
            finally
            {
                logger.Info("Cleaning up...");

                if (nodePool != null)
                {
                    await DeleteNodePool(containerEngineClient, nodePool.Id);
                }
                if (cluster != null)
                {
                    await DeleteCluster(containerEngineClient, cluster.Id);
                }
                for (int i = 0; i < 2; i++)
                {
                    if (subnets[i] != null)
                    {
                        await DeleteSubnet(vcnClient, subnets[i]);
                    }
                }
                if (vcn != null)
                {
                    await DeleteVcn(vcnClient, vcn);
                }

                containerEngineClient.Dispose();
                vcnClient.Dispose();
                identityClient.Dispose();
            }
            logger.Info("End example");
        }
        public static async Task MainInstance()
        {
            logger.Info("Starting example");

            var provider      = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
            var compartmentId = Environment.GetEnvironmentVariable("OCI_COMPARTMENT_ID");

            var identityClient       = new IdentityClient(provider);
            var computeClient        = new ComputeClient(provider, new ClientConfiguration());
            var virtualNetworkClient = new VirtualNetworkClient(provider);
            var blockStorageClient   = new BlockstorageClient(provider);
            var networkCidrBlock     = "10.0.1.0/24";

            LaunchInstanceDetails launchInstanceDetails = null;
            Instance          instance               = null;
            BootVolume        bootVolume             = null;
            Instance          instanceFromBootVolume = null;
            Vcn               vcn               = null;
            Subnet            subnet            = null;
            CreateVnicDetails createVnicDetails = null;
            InternetGateway   internetGateway   = null;

            AvailabilityDomain availablityDomain = await getAvailabilityDomains(identityClient, compartmentId);

            logger.Info($"availability domain is {availablityDomain.Name}");

            Shape shape = await getShape(computeClient, compartmentId, availablityDomain);

            if (shape == null)
            {
                logger.Error($"No Shapes available in the availability domain: {availablityDomain.Name}");
                return;
            }
            logger.Info($"shape is {shape.ShapeProp}");
            Image image = await getImage(computeClient, compartmentId, shape);

            try
            {
                vcn = await createVcn(virtualNetworkClient, compartmentId, networkCidrBlock);

                // The Internet Gateway with updated Route Rules will enable the instance to connect to the public
                // internet. If it is not desired, remove the following two lines below that create an internet
                // gateway and add that internet gateway to the VCN route table.
                internetGateway = await createInternalGateway(virtualNetworkClient, compartmentId, vcn);
                await addInternetGatewayToDefaultRouteTable(virtualNetworkClient, vcn, internetGateway);

                subnet = await createSubnet(virtualNetworkClient, compartmentId, availablityDomain, networkCidrBlock, vcn);

                createVnicDetails = new CreateVnicDetails {
                    SubnetId = subnet.Id
                };

                launchInstanceDetails = new LaunchInstanceDetails
                {
                    AvailabilityDomain = availablityDomain.Name,
                    CompartmentId      = compartmentId,
                    Shape             = shape.ShapeProp,
                    CreateVnicDetails = createVnicDetails,
                    ImageId           = image.Id
                };

                instance = await createInstance(computeClient, launchInstanceDetails);
                await printInstance(computeClient, virtualNetworkClient, instance);

                logger.Info("Instance is being created via boot volume ...");
                // This boot volume is created based on the boot volume of previous instance which needs to be running
                bootVolume = await createBootVolume(blockStorageClient, compartmentId, availablityDomain, image);

                launchInstanceDetails  = createLaunchInstanceDetailsFromBootVolume(launchInstanceDetails, bootVolume);
                instanceFromBootVolume = await createInstance(computeClient, launchInstanceDetails);
                await printInstance(computeClient, virtualNetworkClient, instanceFromBootVolume);
            }
            catch (Exception e)
            {
                logger.Error($"Failed to call LaunchInstance API: {e.Message}");
            }
            finally
            {
                logger.Info("cleaning up resources");
                if (instanceFromBootVolume != null)
                {
                    await terminateInstance(computeClient, instanceFromBootVolume);
                }

                if (instance != null)
                {
                    await terminateInstance(computeClient, instance);
                }

                if (internetGateway != null)
                {
                    await clearRouteRulesFromDefaultRouteTable(virtualNetworkClient, vcn);
                    await deleteInternetGateway(virtualNetworkClient, internetGateway);
                }

                if (subnet != null)
                {
                    await deleteSubnet(virtualNetworkClient, subnet);
                }

                if (vcn != null)
                {
                    await deleteVcn(virtualNetworkClient, vcn);
                }

                identityClient.Dispose();
                computeClient.Dispose();
                virtualNetworkClient.Dispose();
                blockStorageClient.Dispose();

                logger.Info("End example");
            }
        }
Ejemplo n.º 11
0
        static async Task MainDatabase(string[] args)
        {
            string compartmentId = Environment.GetEnvironmentVariable("OCI_COMPARTMENT_ID");
            string adminPassword = Environment.GetEnvironmentVariable("PASSWORD");

            logger.Info("Starting example");
            // Accepts profile name and creates a auth provider based on config file
            var provider = new ConfigFileAuthenticationDetailsProvider(OciConfigProfileName);

            var identityClient       = new IdentityClient(provider);
            var virtualNetworkClient = new VirtualNetworkClient(provider);
            var databaseClient       = new DatabaseClient(provider);
            var networkCidrBlock     = "10.0.1.0/24";

            Vcn    vcn        = null;
            Subnet subnet     = null;
            string dbSystemId = null;

            AvailabilityDomain availablityDomain = await getAvailabilityDomains(identityClient, compartmentId);

            logger.Info($"availability domain is {availablityDomain.Name}");

            try
            {
                vcn = await createVcn(virtualNetworkClient, compartmentId, networkCidrBlock);

                subnet = await createSubnet(virtualNetworkClient, compartmentId, availablityDomain, networkCidrBlock, vcn);

                logger.Info("Launching Database....");

                LaunchDbSystemDetails launchDbSystemDetails = new LaunchDbSystemDetails
                {
                    AvailabilityDomain = availablityDomain.Name,
                    CompartmentId      = compartmentId,
                    CpuCoreCount       = 4,
                    Shape         = "BM.DenseIO2.52",
                    SshPublicKeys = new List <string> {
                        "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyyA8wePstPC69PeuHFtOwyTecByonsHFAjHbVnZ+h0dpomvLZxUtbknNj3+c7MPYKqKBOx9gUKV/diR/mIDqsb405MlrI1kmNR9zbFGYAAwIH/Gxt0Lv5ffwaqsz7cECHBbMojQGEz3IH3twEvDfF6cu5p00QfP0MSmEi/eB+W+h30NGdqLJCziLDlp409jAfXbQm/4Yx7apLvEmkaYSrb5f/pfvYv1FEV1tS8/J7DgdHUAWo6gyGUUSZJgsyHcuJT7v9Tf0xwiFWOWL9WsWXa9fCKqTeYnYJhHlqfinZRnT/+jkz0OZ7YmXo6j4Hyms3RCOqenIX1W6gnIn+eQIkw== This is the key's comment"
                    },
                    SubnetId        = subnet.Id,
                    DatabaseEdition = LaunchDbSystemDetails.DatabaseEditionEnum.EnterpriseEdition,
                    DisplayName     = "OCI DotNet SDK database",
                    Hostname        = "oci-dotnetsdk-host",
                    Domain          = "testdomain",
                    DbHome          = new CreateDbHomeDetails
                    {
                        DbVersion   = "12.1.0.2",
                        DisplayName = "Example DB Home",
                        Database    = new CreateDatabaseDetails
                        {
                            DbName        = "dotnetdb",
                            AdminPassword = adminPassword
                        }
                    }
                };

                LaunchDbSystemRequest launchDbSystemRequest = new LaunchDbSystemRequest
                {
                    LaunchDbSystemDetails = launchDbSystemDetails
                };
                LaunchDbSystemResponse launchDbSystemResponse = await databaseClient.LaunchDbSystem(launchDbSystemRequest);

                logger.Info($"Database ID: {launchDbSystemResponse.DbSystem.Id} and Database display name: {launchDbSystemResponse.DbSystem.DisplayName}");
                logger.Info("Waiting for Database to come to available state....");

                GetDbSystemRequest getDbSystemRequest = new GetDbSystemRequest
                {
                    DbSystemId = launchDbSystemResponse.DbSystem.Id
                };
                WaiterConfiguration waiterConfiguration = new WaiterConfiguration
                {
                    MaxAttempts           = 20,
                    GetNextDelayInSeconds = DelayStrategy.GetExponentialDelayInSeconds
                };
                GetDbSystemResponse getDbSystemResponse = databaseClient.Waiters.ForDbSystem(
                    getDbSystemRequest, waiterConfiguration, DbSystem.LifecycleStateEnum.Available).Execute();

                logger.Info("Database is available");
                logger.Info($"Database ID: {getDbSystemResponse.DbSystem.Id} and Database display name: {getDbSystemResponse.DbSystem.DisplayName}");
                dbSystemId = getDbSystemResponse.DbSystem.Id;
            }
            catch (Exception e)
            {
                logger.Error($"failed to launch DbSystem: {e}");
            }
            finally
            {
                if (dbSystemId != null)
                {
                    await terminateDbSystem(databaseClient, dbSystemId);
                }

                if (subnet != null)
                {
                    await deleteSubnet(virtualNetworkClient, subnet);
                }

                if (vcn != null)
                {
                    await deleteVcn(virtualNetworkClient, vcn);
                }

                identityClient.Dispose();
                virtualNetworkClient.Dispose();
                databaseClient.Dispose();

                logger.Info("End example");
            }
        }
Ejemplo n.º 12
0
        public static async Task MainFileStorage()
        {
            logger.Info("Starting example");

            var provider              = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
            var compartmentId         = Environment.GetEnvironmentVariable("OCI_COMPARTMENT_ID");
            var fileSystemDisplayName = Environment.GetEnvironmentVariable("FILE_SYSTEM_DISPLAY_NAME");

            var identityClient    = new IdentityClient(provider);
            var fileStorageClient = new FileStorageClient(provider);
            var vcnClient         = new VirtualNetworkClient(provider);

            Vcn         vcn         = null;
            Subnet      subnet      = null;
            FileSystem  fileSystem  = null;
            MountTarget mountTarget = null;
            Export      export      = null;
            Snapshot    snapshot    = null;

            try
            {
                var availablityDomain = await GetAvailabilityDomain(identityClient, compartmentId);

                logger.Info($"availability domain is {availablityDomain.Name}");

                // A VCN and subnet is required to create a mount target
                vcn = await CreateVcn(vcnClient, compartmentId);

                subnet = await CreateSubnet(vcnClient, compartmentId, availablityDomain, vcn);

                fileSystem = await CreateFileSystem(fileStorageClient, compartmentId,
                                                    fileSystemDisplayName, availablityDomain);

                mountTarget = await CreateMountTarget(fileStorageClient, vcnClient,
                                                      compartmentId, fileSystemDisplayName + "-mnt", availablityDomain, subnet);
                await GetExportSet(fileStorageClient, mountTarget.ExportSetId);

                export = await CreateExport(fileStorageClient, fileSystem.Id, mountTarget.ExportSetId);

                ListExports(fileStorageClient, compartmentId, fileSystem, mountTarget);

                snapshot = await CreateSnapshot(fileStorageClient, fileSystem);
            }
            catch (Exception e)
            {
                logger.Error($"Failed to mount file system: {e}");
            }
            finally
            {
                logger.Info("cleaning resources....");

                if (snapshot != null)
                {
                    await DeleteSnapshot(fileStorageClient, snapshot);
                }

                if (export != null)
                {
                    await DeleteExport(fileStorageClient, export);
                }

                if (mountTarget != null)
                {
                    await DeleteMountTarget(fileStorageClient, mountTarget);
                }

                if (fileSystem != null)
                {
                    await DeleteFileSystem(fileStorageClient, fileSystem);
                }

                if (subnet != null)
                {
                    await DeleteSubnet(vcnClient, subnet);
                }

                if (vcn != null)
                {
                    await DeleteVcn(vcnClient, vcn);
                }

                identityClient.Dispose();
                fileStorageClient.Dispose();
                vcnClient.Dispose();

                logger.Info("End example");
            }
        }