New-ITGlueLocation
SYNOPSIS
Create a location / Create a location for a particular organization
SYNTAX
Create (Default)
New-ITGlueLocation -Data <Object> [-Raw] [-WhatIf] [-Confirm]
ByOrganization
New-ITGlueLocation [-OrganizationId] <long> -Data <Object> [-Raw] [-WhatIf] [-Confirm]
ALIASES
This cmdlet has the following aliases,
- None
DESCRIPTION
Parameter set [ Create ] - The New-ITGlueLocation cmdlet invokes the POST method of the /locations endpoint (Create a location)
Creates a new location under the specified organization. The :organization_id is specified in the URL or in the request body for ‘/locations’ route. Returns a 201 status on success; the created object is returned the response body.
The request body must contain a JSON object, for example:
{ “data”: { “type”: “locations”, “attributes”: { “organization_id”: 1, “name”: “Main”, “address_1”: “1550 Bryant St”, “address_2”: “7th Floor”, “City”: “San Francisco”, “postal_code”: “94103”, “region_id”: 26, “country_id”: 84 } } }
Use the nested relationships route to add multiple locations to an organization in bulk.
The request body must contain a JSON object, for example:
{ “data”: [ { “type”: “locations”, “attributes”: { “name”: “Main”, “address_1”: “1550 Bryant St”, “address_2”: “7th Floor”, “City”: “San Francisco”, “postal_code”: “94103”, “region_id”: 26, “country_id”: 84 } }, { “type”: “locations”, “attributes”: { “name”: “IBM Nederland BV”, “address_1”: “Johan Huizingalaan 765”, “address_2”: null, “City”: “Amsterdam”, “postal_code”: “1066 VH”, “phone”: “310205145452” } } ] }
Parameter set [ ByOrganization ] - The New-ITGlueLocation cmdlet invokes the POST method of the /organizations/{organization_id}/relationships/locations endpoint (Create a location for a particular organization)
Creates a new location under the specified organization. The :organization_id is specified in the URL or in the request body for ‘/locations’ route. Returns a 201 status on success; the created object is returned the response body.
The request body must contain a JSON object, for example:
{ “data”: { “type”: “locations”, “attributes”: { “organization_id”: 1, “name”: “Main”, “address_1”: “1550 Bryant St”, “address_2”: “7th Floor”, “City”: “San Francisco”, “postal_code”: “94103”, “region_id”: 26, “country_id”: 84 } } }
Use the nested relationships route to add multiple locations to an organization in bulk.
The request body must contain a JSON object, for example:
{ “data”: [ { “type”: “locations”, “attributes”: { “name”: “Main”, “address_1”: “1550 Bryant St”, “address_2”: “7th Floor”, “City”: “San Francisco”, “postal_code”: “94103”, “region_id”: 26, “country_id”: 84 } }, { “type”: “locations”, “attributes”: { “name”: “IBM Nederland BV”, “address_1”: “Johan Huizingalaan 765”, “address_2”: null, “City”: “Amsterdam”, “postal_code”: “1066 VH”, “phone”: “310205145452” } } ] }
This is a write function. It changes data in ITGlue. Use -WhatIf to see the request without sending it
EXAMPLES
EXAMPLE 1
New-ITGlueLocation -Data @{} -WhatIf
Shows the POST request to the /locations endpoint without sending it
EXAMPLE 2
New-ITGlueLocation -OrganizationId 12345 -Data @{} -WhatIf
Shows the POST request to the /organizations/{organization_id}/relationships/locations 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) - locations
- attributes (object):
- address_1 (string)
- address_2 (string)
- city (string)
- country_id (integer)
- fax (string)
- id (integer) - Required identifier for bulk updates
- name (string)
- notes (string)
- organization_id (integer) - Not required when using nested relationship routes
- phone (string)
- postal_code (string)
- primary (boolean)
- region_id (integer)
- restricted (boolean)
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByOrganization
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
- Name: Create
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-OrganizationId
Only required for nested relationships route.
Notes: Must be a valid organization ID in your account.
Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases:
- organization_id
ParameterSets:
- Name: ByOrganization
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 : POST /locations Endpoint : POST /organizations/{organization_id}/relationships/locations