Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Daniel Meltzer
    @dmeltzer
    it could turn into a giant amount of data on the index
    maybe
    snipe
    @snipe
    Yeah, that’s my concern as well - although I mean, if the developer doesn’t paginate and crashes their shit, that’s also on them
    chadnielsen
    @chadnielsen
    Good morning! I'm looking for some guidance on updating custom fields for an asset using the API. I've been successful with GET (both stock and custom fields) and PATCH (just stock fields). I do not receive an error, and the custom field does not honor the update.
    If this is not the correct channel for this request, I apologize.
    darthvidur
    @darthvidur
    Hello stupid question here!
    I'm planning to add a post install script to our windows images. To automatically register new computers.
    I'm a copy/pasta man but I usually solve things through a bit of googleing. But what 'm a bit unsure of is this possible to achieve through powershell or do I need some other scripting language?
    snipe
    @snipe
    Unfortunately, I don’t know powershell well enough to answer you, but I’m sure it can be done with powershell
    darthvidur
    @darthvidur
    Great! Thank you!
    Brian Monroe
    @ParadoxGuitarist
    @chadnielsen
    I'm looking for some guidance on updating custom fields for an asset using the API.
    I have this question too. I noticed that in hardware post, we pass the model_id number, which is nested in get. Since custom fields are nested too, is there a shorthand for put or patch ? like custom_field_1 for the MAC address?
    snipe
    @snipe
    Yeah, you just refer to the db_column_name. This thread might help: snipe/snipe-it#4593
    Brian Monroe
    @ParadoxGuitarist
    bam! Thanks @snipe !
    snipe
    @snipe
    (column names are exposed in the custom fields UI)
    Brian Monroe
    @ParadoxGuitarist
    :+1:
    cwoods131
    @cwoods131
    Hi, does anyone know how to query the api to disclude a certain id? I was expecting something like: api/v1/hardware?status_id!=4
    Daniel Meltzer
    @dmeltzer
    that's not currently possible
    if you're just looking to filter one, it would probably be easier to do client side
    if you're looking to filter a large number.. I'd open a feature request
    cwoods131
    @cwoods131
    Ok thank you!
    JonathanTab
    @JonathanTab
    Is there a way to set the location of an asset?
    JonathanTab
    @JonathanTab
    without checking it out? I'd like my assets to be at a location when I create them, instead of merely having a default
    Daniel Meltzer
    @dmeltzer
    rtd_location_id
    (ready to deploy)
    JonathanTab
    @JonathanTab
    yeah, but that doesn't actually set the location
    so, for instance, if I wanted to just get the "location" of an asset thats never been deployed, the
    "location" field would be empty
    (in the UI, you can assign the rtd_location_id to the actual location, by clicking edit and then saving
    Daniel Meltzer
    @dmeltzer
    waiting for snipe to chime in... we did some database workarounds for performance reasons.. can't remember exactly how it all goes together now
    it may be as easy as just setting the location_id directly on the asset
    but not sure if that would have sideffects
    JonathanTab
    @JonathanTab
    I tried doing that with a patch, but it didn't seem to change anything
    found this in the API code
            ($request->has('rtd_location_id')) ?
                $asset->rtd_location_id = $request->get('rtd_location_id') : '';
            ($request->has('rtd_location_id')) ?
                $asset->location_id = $request->get('rtd_location_id') : '';
    changing rtd_location_id from the API doesn't seem to set the location though
    JonathanTab
    @JonathanTab
    wait... it doesn't change anything actually
    am I doing this right?
    weird, I had a forward slash after the asset id, which was causing it to say it updated correctly, but not actually make any change
    well, thats better
    now the question is can I get rid of the default location without removing the current location
    and it looks like thats a no
    Rob Smithers
    @SmithersJr
    Is there anything weird about using "patch" to update an asset's specific field?
    I am having problem doing this from python or testing it from Postman.
    Brian Monroe
    @ParadoxGuitarist
    Not afaik @SmithersJr . I'm running it every hour and seeing successful updates with https://github.com/ParadoxGuitarist/jamf2snipe/blob/master/jamf2snipe line 193
    cwoods131
    @cwoods131
    A few of our services stopped working today, exactly a year since implementation. I added a new API Token to the scripts which resolved the issue. I do not recall seeing anything about API Tokens expiring after a year. I was hoping one of you might know if this is definitely the case, and if there is anywhere this can be altered. Thank you in advance
    cwoods131
    @cwoods131
    @snipe Just wondering if you knew the answer to the above question. Thank you in advance
    Alexander Coates
    @avcoates
    Is there a reason why getting all assets or a single assets has a property:
    "created_at": {
    "datetime": "2019-06-05 15:24:28",
    "formatted": "2019-06-05 03:24 PM"
    }
    and a patch response returns a payload with a created_at property like this:
    "created_at": "2019-06-05 15:24:28"
    There are a few more properties in both responses that make for annoying inconsistencies. Why not just return an asset in the payload instead of plucking apart properties?
    ichayapet
    @ichayapet
    Is there any way to search for the asset id number? (not the asset tag, the id number)
    ichayapet
    @ichayapet
    Who uses component section of Snipe-IT and what do you track in that area?