Creating a Security Policy Backup

Below is the example of using the SetMbSecSnapshot operation to create a security policy backup. The request contains moniker of the object for working with backups. The response contains moniker of the binary file that stores a backup.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetMbSecSnapshot xmlns="http://www.prognoz.ru/PP.SOM.Som">
<tMbSecSnapshot xmlns="">
  <id>S1!M!S!SecSna1</id>
  </tMbSecSnapshot>
<tArg xmlns="">
<pattern>
  <all>true</all>
  </pattern>
<meta>
<execute>
  <command>Save</command>
  <async>false</async>
  </execute>
  </meta>
<metaGet>
  <all>true</all>
  </metaGet>
  </tArg>
  </SetMbSecSnapshot>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetMbSecSnapshotResult xmlns="http://www.prognoz.ru/PP.SOM.Som" xmlns:q1="http://www.prognoz.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>S1!M!S!SecSna1</id>
  </id>
<meta xmlns="">
<execute>
  <resolveTimeout>600000</resolveTimeout>
  <state>Finished</state>
<savedSnapshot>
  <id>S1!M!Bin!0</id>
  </savedSnapshot>
  </execute>
<log>
  <its />
  </log>
  </meta>
  </SetMbSecSnapshotResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{

 "SetMbSecSnapshot" :

  {

   "tMbSecSnapshot" :

    {

     "id" : "S1!M!S!SecSna1"

    },

   "tArg" :

    {

     "pattern" :

      {

       "all" : "true"

      },

     "meta" :

      {

       "execute" :

        {

         "command" : "Save",

         "async" : "false"

        }

      },

     "metaGet" :

      {

       "all" : "true"

      }

    }

  }

}

JSON response:

{

 "SetMbSecSnapshotResult" :

  {

   "id" :

    {

     "id" : "S1!M!S!SecSna1"

    },

   "meta" :

    {

     "execute" :

      {

       "resolveTimeout" : "600000",

       "state" : "Finished",

       "savedSnapshot" :

        {

         "id" : "S1!M!Bin!0"

        }

      },

     "log" :

      {

       "its" : ""

      }

    }

  }

}

public static SetMbSecSnapshotResult SaveSnapshot(string secSnapshot)
{
    var somClient = new SomPortTypeClient(); //Proxy object for operation execution
    //Operation execution parameters
    var tSet = new SetMbSecSnapshot()
    {
        tArg = new SetMbSecSnapshotArg()
        {
            meta = new MbSecSnapshotMd()
            {
                execute = new MbSecSnapshotExecute()
                {
                    command = MbSecSnapshotExecuteCommand.Save,
                    async = false
                }
            },
            pattern = new MbSecSnapshotMdPattern()
            {
                all = true
            },
            metaGet = new MbSecSnapshotMdPattern()
            {
                all = true
            }
        },
        tMbSecSnapshot = new MbSecSnapshotId() { id = secSnapshot }
    };
    //Save security policy backup
    var result = somClient.SetMbSecSnapshot(tSet);
    return result;
}

See also:

SetMbSecSnapshot