public static GetPrivateIpResponse Unmarshall(UnmarshallerContext _ctx) { GetPrivateIpResponse getPrivateIpResponse = new GetPrivateIpResponse(); getPrivateIpResponse.HttpResponse = _ctx.HttpResponse; getPrivateIpResponse.RequestId = _ctx.StringValue("GetPrivateIp.RequestId"); getPrivateIpResponse.PrivateIp = _ctx.StringValue("GetPrivateIp.PrivateIp"); return(getPrivateIpResponse); }
/** * Creates a mount target and waits for it to become available. We recommend to retry these requests * so that if you receive a timeout or server error and you won't run into the risk of creating multiple resources. * * This creates a mount target WITHOUT specifying a hostname. This means that the mount target will only be accessible * via its private IP address. * * @param fsClient the service client to use to create the mount target * @param vcnClient a client used to communiate with the Virtual Networking service * @param compartmentId the OCID of the compartment where the file system will be created * @param displayName the display name of the mount target * @param availabilityDomain the availability domain where the file system will be created * @param subnet the subnet where the mount target will reside. If no private IP address is explicitly specified at * creation time then the mount target will be assigned a free private IP address from the subnet * * @return the created mount target */ private static async Task <MountTarget> CreateMountTarget(FileStorageClient fsClient, VirtualNetworkClient vcnClient, string compartmentId, string displayName, AvailabilityDomain availabilityDomain, Subnet subnet) { logger.Info("Creating mount target......"); CreateMountTargetDetails createDetails = new CreateMountTargetDetails { AvailabilityDomain = availabilityDomain.Name, SubnetId = subnet.Id, CompartmentId = compartmentId, DisplayName = displayName }; CreateMountTargetRequest createRequest = new CreateMountTargetRequest { CreateMountTargetDetails = createDetails }; var retryConfiguration = new RetryConfiguration { MaxAttempts = 5 }; CreateMountTargetResponse createResponse = await fsClient.CreateMountTarget(createRequest, retryConfiguration); logger.Info($"Created Mount target: {createResponse.MountTarget.DisplayName}"); logger.Info("Waiting for mount target to become available"); GetMountTargetRequest getRequest = new GetMountTargetRequest { MountTargetId = createResponse.MountTarget.Id }; GetMountTargetResponse getResponse = fsClient.Waiters.ForMountTarget(getRequest, MountTarget.LifecycleStateEnum.Active).Execute(); logger.Info($"Mount target state: {getResponse.MountTarget.LifecycleState}"); string mountTargetPrivateIpId = getResponse.MountTarget.PrivateIpIds[0]; GetPrivateIpRequest getPrivateIpRequest = new GetPrivateIpRequest { PrivateIpId = mountTargetPrivateIpId }; GetPrivateIpResponse getPrivateIpResponse = await vcnClient.GetPrivateIp(getPrivateIpRequest); logger.Info($"Mount target private IP: {getPrivateIpResponse.PrivateIp.IpAddress}"); return(getResponse.MountTarget); }