Set-ITGlueModel

SYNOPSIS

Update multiple models / Update a model / Update a model for a particular manufacturer

SYNTAX

BulkUpdate (Default)

Set-ITGlueModel -Data <Object> [-FilterId <long>] [-Raw] [-WhatIf] [-Confirm]

ByManufacturerById

Set-ITGlueModel [-ManufacturerId] <long> [-Id] <long> -Data <Object> [-Raw] [-WhatIf] [-Confirm]

ById

Set-ITGlueModel [-Id] <long> -Data <Object> [-Raw] [-WhatIf] [-Confirm]

ALIASES

This cmdlet has the following aliases,

  • None

DESCRIPTION

Parameter set [ BulkUpdate ] - The Set-ITGlueModel cmdlet invokes the PATCH method of the /models endpoint (Update multiple models)

Updates a list of model names, also known as bulk updating. Bulk updates using a nested relationships route are not supported. Returns 422 Bad Request error if trying to update an externally synced record.

The request body must contain a JSON array with one or more objects:

{ “data”: [ { “type”: “models”, “attributes”: { “id”: 1, “name”: “MX64”, “manufacturer-id”: 494 } }, { “type”: “models”, “attributes”: { “id”: 2, “name”: “MX80”, “manufacturer-id”: 494 } }, { “type”: “models”, “attributes”: { “id”: 3, “name”: “MX42”, “manufacturer-id”: 494 } } ] }

Parameter set [ ById ] - The Set-ITGlueModel cmdlet invokes the PATCH method of the /models/{id} endpoint (Update a model)

Updates an existing model name. Returns 422 Bad Request error if trying to update an externally synced record.

The request body must contain a JSON object, for example:

{ “data”: { “type”: “models”, “attributes”: { “name”: “MX80”, “manufacturer-id”: 494 } } }

Parameter set [ ByManufacturerById ] - The Set-ITGlueModel cmdlet invokes the PATCH method of the /manufacturers/{manufacturer_id}/relationships/models/{id} endpoint (Update a model for a particular manufacturer)

Updates an existing model name. Returns 422 Bad Request error if trying to update an externally synced record.

The request body must contain a JSON object, for example:

{ “data”: { “type”: “models”, “attributes”: { “name”: “MX80”, “manufacturer-id”: 494 } } }

This is a write function. It changes data in ITGlue. Use -WhatIf to see the request without sending it

EXAMPLES

EXAMPLE 1

Set-ITGlueModel -Data @{} -WhatIf

Shows the PATCH request to the /models endpoint without sending it

EXAMPLE 2

Set-ITGlueModel -Id 12345 -Data @{} -WhatIf

Shows the PATCH request to the /models/{id} endpoint without sending it

EXAMPLE 3

Set-ITGlueModel -ManufacturerId 12345 -Id 12345 -Data @{} -WhatIf

Shows the PATCH request to the /manufacturers/{manufacturer_id}/relationships/models/{id} endpoint without sending it

PARAMETERS

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Data

Defines the data of the JSON:API request body. Accepts a hashtable, an object, or a JSON string

The value is sent as the data property of the request body, such as @{ type = ‘organizations’; attributes = @{ name = ‘Example’ } }. An object with a single data property & a JSON string are sent as is

Body properties:

  • type (string) - models
  • attributes (object):
    • id (integer) - Required identifier for bulk updates
    • manufacturer_id (integer) - Not required when using nested relationship routes
    • name (string)
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByManufacturerById
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
- Name: ById
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
- Name: BulkUpdate
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-FilterId

Filter by id

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: BulkUpdate
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Id

Defines the ID of the item

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByManufacturerById
  Position: 1
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
- Name: ById
  Position: 0
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ManufacturerId

Only required for nested relationships route

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases:
- manufacturer_id
ParameterSets:
- Name: ByManufacturerById
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Raw

Returns the full API response (data, meta, links, & included) instead of only the data

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-WhatIf

Runs the command in a mode that only reports what would happen without performing the actions.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.Int64

OUTPUTS

NOTES

Endpoint : PATCH /models Endpoint : PATCH /models/{id} Endpoint : PATCH /manufacturers/{manufacturer_id}/relationships/models/{id}