/// <summary>
 ///
 /// </summary>
 /// <param name="request">
 /// The request object containing all of the parameters for the API call.
 /// </param>
 /// <param name="callSettings">
 /// If not null, applies overrides to this RPC call.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public override async stt::Task <lro::Operation <Snapshot, TakeSnapshotMetadata> > TakeSnapshotAsync(
     TakeSnapshotRequest request,
     gaxgrpc::CallSettings callSettings = null)
 {
     Modify_TakeSnapshotRequest(ref request, ref callSettings);
     return(new lro::Operation <Snapshot, TakeSnapshotMetadata>(
                await _callTakeSnapshot.Async(request, callSettings).ConfigureAwait(false), TakeSnapshotOperationsClient));
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="request">
 /// The request object containing all of the parameters for the API call.
 /// </param>
 /// <param name="callSettings">
 /// If not null, applies overrides to this RPC call.
 /// </param>
 /// <returns>
 /// The RPC response.
 /// </returns>
 public override lro::Operation <Snapshot, TakeSnapshotMetadata> TakeSnapshot(
     TakeSnapshotRequest request,
     gaxgrpc::CallSettings callSettings = null)
 {
     Modify_TakeSnapshotRequest(ref request, ref callSettings);
     return(new lro::Operation <Snapshot, TakeSnapshotMetadata>(
                _callTakeSnapshot.Sync(request, callSettings), TakeSnapshotOperationsClient));
 }
Example #3
0
        public void TakeSnapshot(string newSnapshotName)
        {
            CheckProfileHasMaster();
            CheckProfileHasVM();

            Log(string.Format("Taking snapshot of VM '{0}' called '{1}'.", profile.VM, newSnapshotName));
            TakeSnapshotRequest request = new TakeSnapshotRequest()
            {
                Vm = profile.VM, SnapshotName = newSnapshotName
            };

            GetMasterClient().TakeSnapshot(request);
        }
Example #4
0
        public TakeSnapshotResponse TakeSnapshot(TakeSnapshotRequest request)
        {
            log.InfoFormat("TakeSnapshot:\n  VM: {0}\n  SnapshotName: {1}", request.Vm, request.SnapshotName);

            string output;
            int    exitCode = ExecuteVBoxCommand("VBoxManage.exe",
                                                 string.Format("snapshot \"{0}\" take \"{1}\"", request.Vm, request.SnapshotName),
                                                 TimeSpan.FromSeconds(30),
                                                 out output);

            if (exitCode != 0)
            {
                throw OperationFailed(
                          "Failed to take snapshot.",
                          ErrorDetails(exitCode, output));
            }

            return(new TakeSnapshotResponse());
        }
Example #5
0
        public TakeSnapshotResponse TakeSnapshot(TakeSnapshotRequest request)
        {
            log.InfoFormat("TakeSnapshot:\n  VM: {0}\n  SnapshotName: {1}", request.Vm, request.SnapshotName);

            string output;
            int exitCode = ExecuteVBoxCommand("VBoxManage.exe",
                string.Format("snapshot \"{0}\" take \"{1}\"", request.Vm, request.SnapshotName),
                TimeSpan.FromSeconds(30),
                out output);

            if (exitCode != 0)
            {
                throw OperationFailed(
                    "Failed to take snapshot.",
                    ErrorDetails(exitCode, output));
            }

            return new TakeSnapshotResponse();
        }
 partial void Modify_TakeSnapshotRequest(ref TakeSnapshotRequest request, ref gaxgrpc::CallSettings settings);
 /// <summary>
 ///
 /// </summary>
 /// <param name="request">
 /// The request object containing all of the parameters for the API call.
 /// </param>
 /// <param name="callSettings">
 /// If not null, applies overrides to this RPC call.
 /// </param>
 /// <returns>
 /// The RPC response.
 /// </returns>
 public virtual lro::Operation <Snapshot, TakeSnapshotMetadata> TakeSnapshot(
     TakeSnapshotRequest request,
     gaxgrpc::CallSettings callSettings = null)
 {
     throw new sys::NotImplementedException();
 }
Example #8
0
        public void TakeSnapshot(string newSnapshotName)
        {
            CheckProfileHasMaster();
            CheckProfileHasVM();

            Log(string.Format("Taking snapshot of VM '{0}' called '{1}'.", profile.VM, newSnapshotName));
            TakeSnapshotRequest request = new TakeSnapshotRequest() { Vm = profile.VM, SnapshotName = newSnapshotName };
            GetMasterClient().TakeSnapshot(request);
        }