ITGlueAPI
:warning: Version 3.0 Refactor & Breaking Changes :warning:
The ITGlueAPI module is being updated to version 3.0, which has been extensively overhauled and may contain various breaking changes. Backwards compatibility was incorporated into as many of the previous commands and their associated parameters in the form of alias.
For example, one might access the /passwords/ API endpoint by running the following PowerShell command with the appropriate parameters:
Get-ITGluePasswords
is now an alias of theGet-ITGluePassword
commandorganization_id
is now an alias of theOrganizationID
command
Get-ITGlueUsers `Alias`
is now
Get-ITGlueUser
Get-ITGluePasswords -organization_id 8675309 `Alias`
is now
Get-ITGluePassword -OrganizationID 8675309
About The Project
The ITGlueAPI offers the ability to read, create, and update much of the data within IT Glue’s documentation platform. That includes organizations, contacts, configuration items, and more. This module serves to abstract away the details of interacting with IT Glue’s API endpoints in such a way that is consistent with PowerShell nomenclature. This gives system administrators and PowerShell developers a convenient and familiar way of using IT Glue’s API to create documentation scripts, automation, and integrations. Full documentation for IT Glue’s RESTful API can be found here.
- :book: Project documentation can be found on Github Pages
- :book: ITGlue’s REST API documentation on their management portal here
ITGlue features a REST API that makes use of common HTTP request methods. In order to maintain PowerShell best practices, only approved verbs are used.
- GET ->
Get-
- POST ->
New
- - PATCH ->
Set-
- DELETE ->
Remove-
Additionally, PowerShell’s verb-noun
nomenclature is respected. Each noun is prefixed with ITGlue
in an attempt to prevent naming problems.
For example, one might access the /users/ API endpoint by running the following PowerShell command with the appropriate parameters:
Get-ITGlueUser
or
Get-ITGlueUser -ID 8675309
Install
This module can be installed directly from the PowerShell Gallery with the following command:
Install-Module -Name ITGlueAPI
- :information_source: This module supports PowerShell 5.0+ and should work in PowerShell Core.
- :information_source: If you are running an older version of PowerShell, or if PowerShellGet is unavailable, you can manually download the main branch and place the ITGlueAPI folder into the (default)
C:\Program Files\WindowsPowerShell\Modules
folder.
Project documentation can be found on Github Pages
- A full list of functions can be retrieved by running
Get-Command -Module ITGlueAPI
. - Help info and a list of parameters can be found by running
Get-Help <command name>
, such as:
Get-Help Get-ITGlueUser
Get-Help Get-ITGlueUser -Full
Initial Setup
After installing this module, you will need to configure both the base URI & API access token that are used to talk with the ITGlue API.
- Run
Add-ITGlueBaseURI
- By default, ITGlue’s
https://api.itglue.com
URI is used. - If you have your own API gateway or proxy, you may put in your own custom URI by specifying the
-BaseUri
parameter:Add-ITGlueBaseURI -BaseUri http://myapi.gateway.example.org
- By default, ITGlue’s
- Run
Add-ITGlueAPIKey -ApiKey 8675309
- It will prompt you to enter your API access token if you do not specify it.
- ITGlue API access token are generated via the ITGlue portal at Admin > Settings > API Keys
- [optional] Run
Export-ITGlueModuleSetting
- This will create a config file at
%UserProfile%\ITGlueAPI
that holds the base uri & API access token information. - Next time you run
Import-Module -Name ITGlueAPI
, this configuration file will automatically be loaded. - :warning: Exporting module settings encrypts your API access token in a format that can only be unencrypted by the user principal that encrypted the secret. It makes use of .NET DPAPI, which for Windows uses reversible encrypted tied to your user principal. This means that you cannot copy your configuration file to another computer or user account and expect it to work.
- :warning: However in Linux\Unix operating systems the secret keys are more obfuscated than encrypted so it is recommend to use a more secure & cross-platform storage method.
- This will create a config file at
Usage
Calling an API resource is as simple as running Get-ITGlue<resourceName>
- The following is a table of supported functions and their corresponding API resources:
- Table entries with [
-
] indicate that the functionality is NOT supported by the ITGlue API at this time.
API Resource | Create | Read | Update | Delete |
---|---|---|---|---|
Attachments | New-ITGlueAttachment | - | Set-ITGlueAttachment | Remove-ITGlueAttachment |
Configuration Interfaces | New-ITGlueConfigurationInterface | Get-ITGlueConfigurationInterface | Set-ITGlueConfigurationInterface | - |
Configuration Statuses | New-ITGlueConfigurationStatus | Get-ITGlueConfigurationStatus | Set-ITGlueConfigurationStatus | - |
Configuration Types | New-ITGlueConfigurationType | Get-ITGlueConfigurationType | Set-ITGlueConfigurationType | - |
Configurations | New-ITGlueConfiguration | Get-ITGlueConfiguration | Set-ITGlueConfiguration | Remove-ITGlueConfiguration |
Contact Types | New-ITGlueContactType | Get-ITGlueContactType | Set-ITGlueContactType | - |
Contacts | New-ITGlueContact | Get-ITGlueContact | Set-ITGlueContact | Remove-ITGlueContact |
Countries | - | Get-ITGlueCountries | - | - |
Documents | - | - | Set-ITGlueDocument | - |
Domains | - | Get-ITGlueDomains | - | - |
Expirations | - | Get-ITGlueExpiration | - | - |
Exports | New-ITGlueExport | Get-ITGlueExport | - | Remove-ITGlueExport |
Flexible Asset Fields | New-ITGlueFlexibleAssetField | Get-ITGlueFlexibleAssetField | Set-ITGlueFlexibleAssetField | Remove-ITGlueFlexibleAssetField |
Flexible Asset Types | New-ITGlueFlexibleAssetType | Get-ITGlueFlexibleAssetType | Set-ITGlueFlexibleAssetType | - |
Flexible Assets | New-ITGlueFlexibleAsset | Get-ITGlueFlexibleAsset | Set-ITGlueFlexibleAsset | Remove-ITGlueFlexibleAsset |
Groups | - | Get-ITGlueGroups | - | - |
Locations | New-ITGlueLocation | Get-ITGlueLocation | Set-ITGlueLocation | Remove-ITGlueLocation |
Logs | - | Get-ITGlueLog | - | - |
Manufacturers | New-ITGlueManufacturer | Get-ITGlueManufacturer | Set-ITGlueManufacturer | - |
Models | New-ITGlueModel | Get-ITGlueModel | Set-ITGlueModel | - |
Operating Systems | - | Get-ITGlueOperatingSystems | - | - |
Organization Statuses | New-ITGlueOrganizationStatus | Get-ITGlueOrganizationStatus | Set-ITGlueOrganizationStatus | - |
Organization Types | New-ITGlueOrganizationType | Get-ITGlueOrganizationType | Set-ITGlueOrganizationType | - |
Organizations | New-ITGlueOrganization | Get-ITGlueOrganization | Set-ITGlueOrganization | Remove-ITGlueOrganization |
Password Categories | New-ITGluePasswordCategory | Get-ITGluePasswordCategory | Set-ITGluePasswordCategory | - |
Passwords | New-ITGluePassword | Get-ITGluePassword | Set-ITGluePassword | Remove-ITGluePassword |
Platforms | - | Get-ITGluePlatform | - | - |
Regions | - | Get-ITGlueRegion | - | - |
Related Items | New-ITGlueRelatedItem | - | Set-ITGlueRelatedItem | Remove-ITGlueRelatedItem |
User Metrics | - | Get-ITGlueUserMetric | - | - |
Users | - | Get-ITGlueUser | Set-ITGlueUser | - |
Each Get-ITGlue*
function will respond with the raw data that ITGlue’s API provides.
- :warning: Returned data is mostly structured the same but can vary between commands.
data
- The actual information requested (this is what most people care about)links
- Links to specific aspects of the datameta
- Information about the number of pages of results are available and other metadata.
Contributing
Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag “enhancement”. Don’t forget to give the project a star! Thanks again!
See the CONTRIBUTING guide for more information about contributing.
License
Distributed under the Apache-2.0 license. See LICENSE
for more information.