• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Cancel task with API

Scheduled Pinned Locked Moved Unsolved
FOG Problems
2
4
321
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P
    processor
    last edited by Jun 11, 2024, 9:39 AM

    Hi

    Admitting few things :

    • Server ip : 10.0.0.1
    • One multicast session
    • Need to cancel one client task belonging to the mutlicast group
    • Task id for the client : 3001

    Runnning the following command should kill the client task or I’am wrong :

    curl -s -L -H "fog-user-token: [token]"  -H "fog-api-token: [token]" http://10.0.0.1/fog/task/3001/[cancel|remove|delete]
    

    Whatever the option I choose (cancel, remove or delete), this API resquest result in a json which is the same as the one I get requesting task info :

    curl -s -L -H "fog-user-token: [token]"  -H "fog-api-token: [token]" http://10.0.0.1/fog/task/3001
    

    Anybody can tell me what I’m doing wrong ?
    I use this document as fog API support : https://news.fogproject.org/simplified-api-documentation/

    Thanks in advance for any help.

    Proc.

    T 1 Reply Last reply Jun 11, 2024, 10:15 AM Reply Quote 0
    • T
      Tom Elliott @processor
      last edited by Jun 11, 2024, 10:15 AM

      @processor Can you provide example?

      If you use cancel|remove|delete, the type shoudl be a DELETE request, you’re currently (from what I can see) doing a get request.

      curl -X "DELETE" -sL -H "fog-user-token: [token]" -H "fog-api-token: [token]" http://10.0.0.1/fog/task/3001
      # OR #
      curl -X "DELETE" -sL -H "fog-user-token: [token]" -H "fog-api-token: [token]" http://10.0.0.1/fog/task/3001/cancel
      # OR #
      curl -X "DELETE" -sL -H "fog-user-token: [token]" -H "fog-api-token: [token]" http://10.0.0.1/fog/task/3001/remove
      # OR #
      curl -X "DELETE" -sL -H "fog-user-token: [token]" -H "fog-api-token: [token]" http://10.0.0.1/fog/task/3001/delete

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      P 1 Reply Last reply Jun 11, 2024, 10:20 AM Reply Quote 0
      • P
        processor @Tom Elliott
        last edited by Jun 11, 2024, 10:20 AM

        @Tom-Elliott

        Thanks Tom !!

        Sorry for this POST I feel so ashamed by this noob mistake.

        So it’s solved!

        T 1 Reply Last reply Jun 11, 2024, 10:22 AM Reply Quote 0
        • T
          Tom Elliott @processor
          last edited by Jun 11, 2024, 10:22 AM

          @processor Don’t feel ashamed. Mistakes happen and that’s what we are all here for.

          The example I was asking for was the output, but then it all clicked. You were doing a Get request 🙂

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            3/4
            Last post

          154

          Online

          12.0k

          Users

          17.3k

          Topics

          155.2k

          Posts
          Copyright © 2012-2024 FOG Project