APIPythonOpen-Source Solutions

  • 1.  Upload file-format with PowerShell

    Posted 11-12-2018 12:18:00 PM
    Anyone having any idea, on how to use powershell to upload a format-file to delphix masking?
    #DemoEnvironment
    #Masking


  • 2.  RE: Upload file-format with PowerShell
    Best Answer

    Posted 11-12-2018 03:13:00 PM
    Hi Torben,
    Thanks for reaching out.

    The PowerShell function Invoke-RestMethod (details here) will be used to call the endpoint as below
    curl -X POST --header 'Content-Type: multipart/form-data' --header  'Accept: application/json' --header 'Authorization:  d1313dd8-2ed9-4699-8e88-2b6a089ae2a6' -F  fileFormat=@/path/to/file_format/delimited_format.txt -F  fileFormatType=DELIMITED 'http://<myMaskingEngine>:8282/masking/api/file-formats'
    This endpoint is available from Delphix 5.3 onwards, detailed documentation is here

    Thanks
    Hims


  • 3.  RE: Upload file-format with PowerShell

    Posted 11-12-2018 05:31:00 PM
    Thanks for you reply.

    In the documentation for version 5.26 you can find the same endpoint doc, are you telling me, despite this doc, the endpoint is first active in release 5.3? :-)

    https://docs.delphix.com/docs526/delphix-masking/masking-api-cookbook/api-calls-involving-file-uploa...

    Im now home, at my test environment (running 5.3), and here it works, will test it in production (5.2) tomorrow




  • 4.  RE: Upload file-format with PowerShell

    Posted 11-13-2018 06:06:00 AM
    Done testing, it works in 5.2.5.0
    Would have preferred to use API, but for now, thats okay.
    Thanks



  • 5.  RE: Upload file-format with PowerShell

    Posted 11-13-2018 08:33:00 AM
    You where so kind to help me with the file-format, file-metadata is also a problem
    This Curl command :

    C:\delphix\curl.exe -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: 9c615d69-6f3a-4f58-8bb9-0b216ffa007f' -d '{ \ "fileName": "C:/Delphix/BS.REC00002.CSV",\ "rulesetId": 52,\ "fileFormatId": 112,\ "delimiter": ";",\ "endOfRecord": "\n" \ }' 'http://pfanpdpxma01.prod.pfaintern.dk:8282/masking/api/file-metadata'

    gives the following output
    curl: (6) Could not resolve host: application
    curl: (6) Could not resolve host: application
    curl: (6) Could not resolve host: 9c615d69-6f3a-4f58-8bb9-0b216ffa007f'
    curl: (6) Could not resolve host: \
    curl: (3) URL using bad/illegal format or missing URL
    curl: (3) URL using bad/illegal format or missing URL
    curl: (3) URL using bad/illegal format or missing URL
    curl: (6) Could not resolve host: 52,\
    curl: (3) URL using bad/illegal format or missing URL
    curl: (6) Could not resolve host: 112,\
    curl: (3) URL using bad/illegal format or missing URL
    curl: (6) Could not resolve host: ;,\
    curl: (3) URL using bad/illegal format or missing URL
    curl: (6) Could not resolve host: \n
    curl: (6) Could not resolve host: \
    curl: (3) unmatched close brace/bracket in URL position 1:
    }'
     ^
    curl: (3) URL using bad/illegal format or missing URL



  • 6.  RE: Upload file-format with PowerShell

    Posted 11-13-2018 08:52:00 AM
    Syntax error.
    C:/Delphix/BS.REC00002.CSV
    is
    BS.REC00002.CSV
    but same error