• Register
    • Login
    • Search
    • Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. sega
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 7
    • Best 1
    • Controversial 0
    • Groups 0

    sega

    @sega

    1
    Reputation
    1
    Profile views
    7
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    sega Unfollow Follow

    Best posts made by sega

    • RE: Coding a shortcut Webview/Problem with the API

      I changed the code to PHP and now it works, so I think it was something security related from the browser.

      posted in General
      S
      sega

    Latest posts made by sega

    • RE: Coding a shortcut Webview/Problem with the API

      I changed the code to PHP and now it works, so I think it was something security related from the browser.

      posted in General
      S
      sega
    • RE: Coding a shortcut Webview/Problem with the API

      This should work (worked at the start), but that’s a good point. I will test it with another API just to get sure.
      The HTML file just runs on a PHP server but has no PHP in it, just HTML and JavaScript. But won’t be a big problem, to rewrite it in PHP, if that’s necessary.

      posted in General
      S
      sega
    • RE: Coding a shortcut Webview/Problem with the API

      Ok, the call in Postman worked now, I just had to change a setting.
      Now I want to import that call in html/js. But I just get an error as response:

      GET http://192.168.xxx.xxx/fog/task/active net::ERR_ABORTED 403 (Forbidden)
      

      I’m pretty sure I have to change something in the fetch function? But I’m not sure. The HTML file is right now running on a local PHP server.

      fetch("http://192.168.xxx.xxx/fog/task/active", {
              method: "GET",
              mode: "no-cors",
              headers: {
                "fog-api-token": "token",
                "fog-user-token": "token"
              }
            })
      
      posted in General
      S
      sega
    • RE: Coding a shortcut Webview/Problem with the API

      @Tom-Elliott I saw this site also and used the example at the end of the page:

      curl -H 'fog-api-token: abcde' -H 'fog-user-token: fghij' -H 'Content-Type: application/json' -X POST -d '{"taskTypeID":13,"deploySnapins":6}' http://fogserver/fog/host/1/task
      

      I used this one, removed the "deploySnapins and changed the taskTypeID into 1, which should stand for the task of deployment. Still the same error. There isn’t any documentation about the various taskTypeIDs, I think thats my main problem.

      posted in General
      S
      sega
    • RE: Coding a shortcut Webview/Problem with the API

      @Tom-Elliott

      The endpoint I’m trying to reach is: http://192.168.0.0/fog/host/128/task
      And as I read in the documentation I have to add taskType: 1 as the body. So basically I just need to know which ID the task “Deploy” has.

      posted in General
      S
      sega
    • Limit the bandwith speed.

      Hi,

      I would like to know if and how it’s possible to limit the brandwith speed for deployment.

      posted in General
      S
      sega
    • Coding a shortcut Webview/Problem with the API

      Hi,

      I’m currently coding a simple-to-use-Webview for my colleagues, it will just contain some buttons to deploy images on hosts/groups. And at this point I have a problem. I want to call the deploy action but I get only this response:

      { "error": "Invalid tasking type passed" }
      

      Followed the documentation on here (https://docs.fogproject.org/en/latest/Knowledge-Base/integrations/api/?h=api#put) so I set the taskType as “1”. I’m testing it in Postman. Other get examples are working, so the token are right.

      Does anyone know what’s the problem? Thank you in advance.

      posted in General api api help fogapi-psmodule
      S
      sega